call handle not matter what

This commit is contained in:
Andras Bacsai 2023-10-18 14:43:48 +02:00
parent e266c7cdec
commit 4f588ced96

View File

@ -19,6 +19,7 @@ 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\Arr; use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str; use Illuminate\Support\Str;
class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted
@ -40,10 +41,8 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted
public function __construct(public Server $server) public function __construct(public Server $server)
{ {
if (isDev()) {
$this->handle(); $this->handle();
} }
}
public function handle() public function handle()
{ {
@ -76,6 +75,7 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted
$this->server->update([ $this->server->update([
'unreachable_count' => 0, 'unreachable_count' => 0,
]); ]);
Log::info("Server {$this->server->id} is reachable.");
} else { } else {
$serverUptimeCheckNumber++; $serverUptimeCheckNumber++;
$this->server->settings()->update([ $this->server->settings()->update([
@ -129,7 +129,6 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted
} catch (\Throwable $e) { } catch (\Throwable $e) {
ray($e); ray($e);
} }
} else { } else {
$this->server->proxy->status = data_get($foundProxyContainer, 'State.Status'); $this->server->proxy->status = data_get($foundProxyContainer, 'State.Status');
$this->server->save(); $this->server->save();