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

@@ -1,5 +1,11 @@
# Changelog # 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) ## 2026-03-16 - 1.14.9 - fix(repo)
no changes to commit no changes to commit

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@serve.zone/onebox', 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' description: 'Self-hosted container platform with automatic SSL and DNS - a mini Heroku for single servers'
} }

View File

@@ -411,6 +411,9 @@ export class Onebox {
try { try {
logger.info('Shutting down Onebox...'); logger.info('Shutting down Onebox...');
// Stop auto-update monitoring
this.services.stopAutoUpdateMonitoring();
// Stop backup scheduler // Stop backup scheduler
await this.backupScheduler.stop(); await this.backupScheduler.stop();

View File

@@ -15,6 +15,7 @@ export class OneboxServicesManager {
private oneboxRef: any; // Will be Onebox instance private oneboxRef: any; // Will be Onebox instance
private database: OneboxDatabase; private database: OneboxDatabase;
private docker: OneboxDockerManager; private docker: OneboxDockerManager;
private autoUpdateIntervalId: number | null = null;
constructor(oneboxRef: any) { constructor(oneboxRef: any) {
this.oneboxRef = oneboxRef; this.oneboxRef = oneboxRef;
@@ -681,7 +682,7 @@ export class OneboxServicesManager {
*/ */
startAutoUpdateMonitoring(): void { startAutoUpdateMonitoring(): void {
// Check every 30 seconds // Check every 30 seconds
setInterval(async () => { this.autoUpdateIntervalId = setInterval(async () => {
try { try {
await this.checkForRegistryUpdates(); await this.checkForRegistryUpdates();
} catch (error) { } catch (error) {
@@ -692,6 +693,17 @@ export class OneboxServicesManager {
logger.info('Auto-update monitoring started (30s interval)'); 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 * Check all services using onebox registry for updates
*/ */

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@serve.zone/onebox', 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' description: 'Self-hosted container platform with automatic SSL and DNS - a mini Heroku for single servers'
} }