fix: overlapping apps
This commit is contained in:
parent
35f19ed53f
commit
dca332a688
@ -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();
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user