diff --git a/app/Console/Commands/CleanupUnreachableServers.php b/app/Console/Commands/CleanupUnreachableServers.php index d94ceeb9c..e3ed4b0df 100644 --- a/app/Console/Commands/CleanupUnreachableServers.php +++ b/app/Console/Commands/CleanupUnreachableServers.php @@ -16,10 +16,10 @@ class CleanupUnreachableServers extends Command $servers = Server::where('unreachable_count', 3)->where('unreachable_notification_sent', true)->where('updated_at', '<', now()->subDays(3))->get(); if ($servers->count() > 0) { foreach ($servers as $server) { - ray('Cleanup unreachable server', $server->id); - // $server->update([ - // 'ip' => '1.2.3.4' - // ]); + ray("Cleanup unreachable server ($server->id) with name $server->name"); + $server->update([ + 'ip' => '1.2.3.4' + ]); } } } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 79f8f38e4..c56feb902 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -36,7 +36,8 @@ class Kernel extends ConsoleKernel } else { // Instance Jobs $schedule->command('horizon:snapshot')->everyFiveMinutes(); - // $schedule->command('cleanup:unreachable-servers')->daily(); + $schedule->command('cleanup:unreachable-servers')->daily(); + $schedule->job(new CleanupInstanceStuffsJob)->everyTwoMinutes()->onOneServer(); // $schedule->job(new CheckResaleLicenseJob)->hourly()->onOneServer();