diff --git a/src/services/database.service.ts b/src/services/database.service.ts index e28e653..7199929 100755 --- a/src/services/database.service.ts +++ b/src/services/database.service.ts @@ -1,6 +1,13 @@ import Services from './service'; +/** + * Database service managing IndexedDB operations via Web Worker and Service Worker + */ export class Database { + // ============================================ + // PRIVATE PROPERTIES + // ============================================ + private static instance: Database; private serviceWorkerRegistration: ServiceWorkerRegistration | null = null; private serviceWorkerCheckIntervalId: number | null = null; @@ -155,13 +162,11 @@ export class Database { }); } - private async checkForUpdates() { + private async checkForUpdates(): Promise { if (this.serviceWorkerRegistration) { - // Check for updates to the service worker try { await this.serviceWorkerRegistration.update(); - // If there's a new worker waiting, activate it immediately if (this.serviceWorkerRegistration.waiting) { this.serviceWorkerRegistration.waiting.postMessage({ type: 'SKIP_WAITING' }); }