fix(services): stop auto-update monitoring during shutdown
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user