fix: schedule the first image-update check on the cron cadence after a restart (#1491)

In cron mode the service armed the first check for two minutes after boot
regardless of the configured schedule, so a restart triggered an out-of-cadence
check (a weekly cron would run on every boot, then follow cron). Arm the first
check at the next cron fire time instead; interval mode keeps its 2-minute
post-boot delay.
This commit is contained in:
Anso
2026-06-27 22:38:31 -04:00
committed by GitHub
parent bee0dfd094
commit 3ad807be45
2 changed files with 93 additions and 2 deletions
+5 -2
View File
@@ -220,8 +220,11 @@ export class ImageUpdateService {
if (this.timer) return;
this.polling = true;
this.configureFromSettings();
// Preserve the existing 2-minute post-boot delay before the first check.
this.armNext(ImageUpdateService.STARTUP_DELAY_MS);
// Interval mode keeps the 2-minute post-boot delay before the first check.
// Cron mode honors its schedule: arm at the next cron fire time so a restart
// never triggers an out-of-cadence check (e.g. a weekly cron must not run on
// every boot).
this.armNext(this.mode === 'cron' ? this.nextDelayMs() : ImageUpdateService.STARTUP_DELAY_MS);
}
public stop() {