fix: overlapping apps

This commit is contained in:
Andras Bacsai 2023-09-04 16:59:02 +02:00
parent 35f19ed53f
commit dca332a688
2 changed files with 6 additions and 7 deletions

View File

@ -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();

View File

@ -2,6 +2,7 @@
namespace App\Jobs;
use App\Models\ApplicationDeploymentQueue;
use App\Models\Server;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
@ -9,7 +10,6 @@
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\Middleware\WithoutOverlapping;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Str;
class DockerCleanupJob implements ShouldQueue
{
@ -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();