feat(jobs): add cache-based deduplication for delayed cron execution

Implements getPreviousRunDate() + cache-based tracking in shouldRunNow()
to prevent duplicate dispatch of scheduled jobs when queue delays push
execution past the cron minute. This resilience ensures jobs catch missed
windows without double-dispatching within the same cron window.

Updated scheduled job dispatches to include dedupKey parameter:
- Docker cleanup operations
- Server connection checks
- Sentinel restart checks
- Server storage checks
- Server patch checks

DockerCleanupJob now dispatches on the 'high' queue for faster processing.

Includes comprehensive test coverage for dedup behavior across different
cron schedules and delay scenarios.
This commit is contained in:
Andras Bacsai committed 2026-03-20 15:44:10 +01:00
1 parent 2bc8fe3dd7
commit 6aa618e57f
5 files changed
+194 -10

No files matched your search

+3 -1
View File
@@ -39,7 +39,9 @@ class DockerCleanupJob implements ShouldBeEncrypted, ShouldQueue
public bool $manualCleanup = false,
public bool $deleteUnusedVolumes = false,
public bool $deleteUnusedNetworks = false
) {}
) {
$this->onQueue('high');
}
public function handle(): void
{