Update container and server status job

This commit is contained in:
Andras Bacsai 2023-12-20 12:25:14 +01:00
parent cd842bc1b2
commit 5f2ad56529
2 changed files with 5 additions and 4 deletions

View File

@ -22,7 +22,7 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $tries = 5;
public $tries = 4;
public function backoff(): int
{
return isDev() ? 1 : 3;

View File

@ -34,9 +34,10 @@ public function handle(): void
{
ray("checking server status for {$this->server->id}");
try {
if ($this->server->isFunctional()) {
if (!$this->server->isServerReady(4)) {
throw new \RuntimeException('Server is not reachable.');
};
$this->cleanup(notify: false);
}
} catch (\Throwable $e) {
send_internal_notification('ServerStatusJob failed with: ' . $e->getMessage());
ray($e->getMessage());