refactor(jobs): update WithoutOverlapping middleware to use expireAfter for better queue management
This commit is contained in:
parent
1b60fd3eb2
commit
b78f2cccff
4 changed files with 6 additions and 4 deletions
|
|
@ -17,11 +17,13 @@ class CleanupInstanceStuffsJob implements ShouldBeEncrypted, ShouldBeUnique, Sho
|
|||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public $timeout = 60;
|
||||
|
||||
public function __construct() {}
|
||||
|
||||
public function middleware(): array
|
||||
{
|
||||
return [(new WithoutOverlapping('cleanup-instance-stuffs'))->dontRelease()];
|
||||
return [(new WithoutOverlapping('cleanup-instance-stuffs'))->expireAfter(60)];
|
||||
}
|
||||
|
||||
public function handle(): void
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class PushServerUpdateJob implements ShouldBeEncrypted, ShouldQueue
|
|||
|
||||
public function middleware(): array
|
||||
{
|
||||
return [(new WithoutOverlapping($this->server->uuid))->dontRelease()];
|
||||
return [(new WithoutOverlapping($this->server->uuid))->expireAfter(30)];
|
||||
}
|
||||
|
||||
public function backoff(): int
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class RestartProxyJob implements ShouldBeEncrypted, ShouldQueue
|
|||
|
||||
public function middleware(): array
|
||||
{
|
||||
return [(new WithoutOverlapping($this->server->uuid))->dontRelease()];
|
||||
return [(new WithoutOverlapping($this->server->uuid))->expireAfter(60)];
|
||||
}
|
||||
|
||||
public function __construct(public Server $server) {}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueue
|
|||
|
||||
public function middleware(): array
|
||||
{
|
||||
return [(new WithoutOverlapping($this->server->uuid))->dontRelease()];
|
||||
return [(new WithoutOverlapping($this->server->uuid))->expireAfter(60)];
|
||||
}
|
||||
|
||||
public function __construct(public Server $server) {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue