fix: overlapping apps
This commit is contained in:
parent
35f19ed53f
commit
dca332a688
@ -67,12 +67,6 @@ class ApplicationDeploymentJob implements ShouldQueue
|
|||||||
private Collection $saved_outputs;
|
private Collection $saved_outputs;
|
||||||
|
|
||||||
public $tries = 1;
|
public $tries = 1;
|
||||||
public function middleware(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
(new WithoutOverlapping("dockerimagejobs"))->shared(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
public function __construct(int $application_deployment_queue_id)
|
public function __construct(int $application_deployment_queue_id)
|
||||||
{
|
{
|
||||||
ray()->clearScreen();
|
ray()->clearScreen();
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Jobs;
|
namespace App\Jobs;
|
||||||
|
|
||||||
|
use App\Models\ApplicationDeploymentQueue;
|
||||||
use App\Models\Server;
|
use App\Models\Server;
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
@ -9,7 +10,6 @@ use Illuminate\Foundation\Bus\Dispatchable;
|
|||||||
use Illuminate\Queue\InteractsWithQueue;
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
use Illuminate\Queue\Middleware\WithoutOverlapping;
|
use Illuminate\Queue\Middleware\WithoutOverlapping;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
use Illuminate\Support\Str;
|
|
||||||
|
|
||||||
class DockerCleanupJob implements ShouldQueue
|
class DockerCleanupJob implements ShouldQueue
|
||||||
{
|
{
|
||||||
@ -30,6 +30,11 @@ class DockerCleanupJob implements ShouldQueue
|
|||||||
}
|
}
|
||||||
public function handle(): void
|
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 {
|
try {
|
||||||
ray()->showQueries()->color('orange');
|
ray()->showQueries()->color('orange');
|
||||||
$servers = Server::all();
|
$servers = Server::all();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user