Refactor: Move sentinel update checks to ServerManagerJob and add tests for hourly dispatch

This commit is contained in:
Andras Bacsai
2025-12-04 14:58:18 +01:00
parent 2302a70a44
commit 4002044877
4 changed files with 338 additions and 12 deletions

View File

@@ -146,6 +146,15 @@ class ServerManagerJob implements ShouldQueue
ServerPatchCheckJob::dispatch($server);
}
// Check for sentinel updates hourly (independent of user-configurable update_check_frequency)
if ($server->isSentinelEnabled()) {
$shouldCheckSentinel = $this->shouldRunNow('0 * * * *', $serverTimezone);
if ($shouldCheckSentinel) {
CheckAndStartSentinelJob::dispatch($server);
}
}
// Dispatch Sentinel restart if due (daily for Sentinel-enabled servers)
$isSentinelEnabled = $server->isSentinelEnabled();
$shouldRestartSentinel = $isSentinelEnabled && $this->shouldRunNow('0 0 * * *', $serverTimezone);