mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-09 02:12:59 +00:00
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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user