From 3a227bd838c2e8b9d5be331b4b96fbbe93825f27 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Mon, 16 Mar 2026 08:40:48 +0000 Subject: [PATCH] fix(services): stop auto-update monitoring during shutdown --- changelog.md | 6 ++++++ ts/00_commitinfo_data.ts | 2 +- ts/classes/onebox.ts | 3 +++ ts/classes/services.ts | 14 +++++++++++++- ts_web/00_commitinfo_data.ts | 2 +- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index cd444b3..1f9b606 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2026-03-16 - 1.14.10 - fix(services) +stop auto-update monitoring during shutdown + +- Track the auto-update polling interval in the services manager +- Clear the auto-update interval when Onebox shuts down to prevent background checks after shutdown + ## 2026-03-16 - 1.14.9 - fix(repo) no changes to commit diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 90c8574..c35ec1b 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/onebox', - version: '1.14.9', + version: '1.14.10', description: 'Self-hosted container platform with automatic SSL and DNS - a mini Heroku for single servers' } diff --git a/ts/classes/onebox.ts b/ts/classes/onebox.ts index 2c9c360..6b451c7 100644 --- a/ts/classes/onebox.ts +++ b/ts/classes/onebox.ts @@ -411,6 +411,9 @@ export class Onebox { try { logger.info('Shutting down Onebox...'); + // Stop auto-update monitoring + this.services.stopAutoUpdateMonitoring(); + // Stop backup scheduler await this.backupScheduler.stop(); diff --git a/ts/classes/services.ts b/ts/classes/services.ts index ea30d9e..d4c6d64 100644 --- a/ts/classes/services.ts +++ b/ts/classes/services.ts @@ -15,6 +15,7 @@ export class OneboxServicesManager { private oneboxRef: any; // Will be Onebox instance private database: OneboxDatabase; private docker: OneboxDockerManager; + private autoUpdateIntervalId: number | null = null; constructor(oneboxRef: any) { this.oneboxRef = oneboxRef; @@ -681,7 +682,7 @@ export class OneboxServicesManager { */ startAutoUpdateMonitoring(): void { // Check every 30 seconds - setInterval(async () => { + this.autoUpdateIntervalId = setInterval(async () => { try { await this.checkForRegistryUpdates(); } catch (error) { @@ -692,6 +693,17 @@ export class OneboxServicesManager { logger.info('Auto-update monitoring started (30s interval)'); } + /** + * Stop auto-update monitoring + */ + stopAutoUpdateMonitoring(): void { + if (this.autoUpdateIntervalId !== null) { + clearInterval(this.autoUpdateIntervalId); + this.autoUpdateIntervalId = null; + logger.debug('Auto-update monitoring stopped'); + } + } + /** * Check all services using onebox registry for updates */ diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index 90c8574..c35ec1b 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/onebox', - version: '1.14.9', + version: '1.14.10', description: 'Self-hosted container platform with automatic SSL and DNS - a mini Heroku for single servers' }