Skip to content

Commit 1180166

Browse files
committed
add unregister method
1 parent 0144edc commit 1180166

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/core/src/v3/serverOnly/shutdownManager.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class ShutdownManager {
3030
this.handlers.set(name, { handler, signals });
3131
}
3232

33+
unregister(name: string) {
34+
this.handlers.delete(name);
35+
}
36+
3337
async shutdown(signal: ShutdownSignal) {
3438
if (this.isShuttingDown) return;
3539
this.isShuttingDown = true;

packages/redis-worker/src/worker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ class Worker<TCatalog extends WorkerCatalog> {
421421
}
422422

423423
public async stop() {
424+
shutdownManager.unregister("redis-worker");
424425
await this.shutdown();
425426
}
426427
}

0 commit comments

Comments
 (0)