Skip to content

Commit

Permalink
fix: overlapping apps
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed Sep 4, 2023
1 parent 35f19ed commit dca332a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 0 additions & 6 deletions app/Jobs/ApplicationDeploymentJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ class ApplicationDeploymentJob implements ShouldQueue
private Collection $saved_outputs;

public $tries = 1;
public function middleware(): array
{
return [
(new WithoutOverlapping("dockerimagejobs"))->shared(),
];
}
public function __construct(int $application_deployment_queue_id)
{
ray()->clearScreen();
Expand Down
7 changes: 6 additions & 1 deletion app/Jobs/DockerCleanupJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace App\Jobs;

use App\Models\ApplicationDeploymentQueue;
use App\Models\Server;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\Middleware\WithoutOverlapping;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Str;

class DockerCleanupJob implements ShouldQueue
{
Expand All @@ -30,6 +30,11 @@ public function __construct()
}
public function handle(): void
{
$queue = ApplicationDeploymentQueue::where('status', '==', 'in_progress')->get();
if ($queue->count() > 0) {
ray('DockerCleanupJob: ApplicationDeploymentQueue is not empty, skipping')->color('orange');
return;
}
try {
ray()->showQueries()->color('orange');
$servers = Server::all();
Expand Down

0 comments on commit dca332a

Please sign in to comment.