diff --git a/ts/cluster/cluster-manager.ts b/ts/cluster/cluster-manager.ts index 46fdc35..fd80424 100644 --- a/ts/cluster/cluster-manager.ts +++ b/ts/cluster/cluster-manager.ts @@ -13,6 +13,7 @@ import type { import { CLUSTER, PATHS } from '../constants.ts'; export class ClusterManager { + private initialized = false; private config: IClusterConfig = { enabled: false, nodeName: 'modelgrid-local', @@ -63,6 +64,8 @@ export class ClusterManager { } catch { // No persisted control state yet. } + + this.initialized = true; } public configure(config: IClusterConfig): void { @@ -384,6 +387,10 @@ export class ClusterManager { } private schedulePersist(): void { + if (!this.initialized) { + return; + } + if (this.persistQueued) { return; } @@ -396,6 +403,10 @@ export class ClusterManager { } private scheduleControlPersist(): void { + if (!this.initialized) { + return; + } + if (this.controlPersistQueued) { return; }