Skip to content

Commit dd6db69

Browse files
authored
fix(worker): avoid a spurious error if Worker receives SIGINT while already shutting down (#1547)
1 parent a7d71fc commit dd6db69

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/worker/src/worker.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,9 @@ export class Worker {
17071707
}
17081708
this.state = 'RUNNING';
17091709

1710-
const shutdownCallback = () => this.shutdown();
1710+
const shutdownCallback = () => {
1711+
if (this.state === 'RUNNING') this.shutdown();
1712+
};
17111713
Runtime.instance().registerShutdownSignalCallback(shutdownCallback);
17121714

17131715
let fatalError: Error | undefined;

0 commit comments

Comments
 (0)