add new resource check to kernel.php

This commit is contained in:
Andras Bacsai
2024-11-03 14:53:44 +01:00
parent 9ff73d62e1
commit 6987951efe
2 changed files with 3 additions and 3 deletions

View File

@@ -2,7 +2,6 @@
namespace App\Console; namespace App\Console;
use App\Actions\Server\ResourcesCheck;
use App\Jobs\CheckAndStartSentinelJob; use App\Jobs\CheckAndStartSentinelJob;
use App\Jobs\CheckForUpdatesJob; use App\Jobs\CheckForUpdatesJob;
use App\Jobs\CheckHelperImageJob; use App\Jobs\CheckHelperImageJob;
@@ -116,7 +115,7 @@ class Kernel extends ConsoleKernel
} else { } else {
$servers = $this->allServers->get(); $servers = $this->allServers->get();
} }
// $schedule->job(new ResourcesCheck)->everyMinute()->onOneServer(); // $schedule->job(new \App\Jobs\ResourcesCheck)->everyMinute()->onOneServer();
foreach ($servers as $server) { foreach ($servers as $server) {
$serverTimezone = $server->settings->server_timezone; $serverTimezone = $server->settings->server_timezone;
@@ -126,6 +125,7 @@ class Kernel extends ConsoleKernel
if (Carbon::parse($lastSentinelUpdate)->isBefore(now()->subSeconds($server->waitBeforeDoingSshCheck()))) { if (Carbon::parse($lastSentinelUpdate)->isBefore(now()->subSeconds($server->waitBeforeDoingSshCheck()))) {
// Check container status every minute if Sentinel does not activated // Check container status every minute if Sentinel does not activated
$schedule->job(new ServerCheckJob($server))->everyMinute()->onOneServer(); $schedule->job(new ServerCheckJob($server))->everyMinute()->onOneServer();
// $schedule->job(new \App\Jobs\ServerCheckNewJob($server))->everyMinute()->onOneServer();
// Check storage usage every 10 minutes if Sentinel does not activated // Check storage usage every 10 minutes if Sentinel does not activated
$schedule->job(new ServerStorageCheckJob($server))->everyTenMinutes()->onOneServer(); $schedule->job(new ServerStorageCheckJob($server))->everyTenMinutes()->onOneServer();

View File

@@ -24,7 +24,7 @@ class ServerCheckNewJob implements ShouldBeEncrypted, ShouldQueue
public function handle() public function handle()
{ {
try { try {
ServerCheck::dispatch($this->server); ServerCheck::run($this->server);
} catch (\Throwable $e) { } catch (\Throwable $e) {
return handleError($e); return handleError($e);
} }