fix(services): stop auto-update monitoring during shutdown

This commit is contained in:
2026-03-16 08:40:48 +00:00
parent f5a7fccfc2
commit 3a227bd838
5 changed files with 24 additions and 3 deletions

View File

@@ -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();

View File

@@ -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
*/