MCPcopy Create free account
hub / github.com/FIND-Lab/AgentWard / shutdown

Method shutdown

worker/model-worker-manager.ts:182–199  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180 }
181
182 shutdown() {
183 if (!this.running) return;
184
185 getLogger().info('[WorkerManager] Shutdown');
186
187 Atomics.or(this.view, 0, 0b100);
188 Atomics.notify(this.view, 0);
189
190 const timeout = setTimeout(() => {
191 getLogger().error('[WorkerManager] Shutdown timeout, force terminate');
192 this.worker.terminate();
193 }, 5000);
194
195 this.worker.on('exit', () => {
196 clearTimeout(timeout);
197 getLogger().info('[WorkerManager] Shutdown completed');
198 });
199 }
200
201 isRunning(): boolean {
202 return this.running;

Callers 2

registerFunction · 0.95
restartWorkerFunction · 0.80

Calls 1

getLoggerFunction · 0.90

Tested by

no test coverage detected