diff --git a/.changeset/popular-ducks-guess.md b/.changeset/popular-ducks-guess.md new file mode 100644 index 00000000000..e8bfc09f8a5 --- /dev/null +++ b/.changeset/popular-ducks-guess.md @@ -0,0 +1,6 @@ +--- +"@effect/platform-node": patch +"@effect/platform-bun": patch +--- + +Fixed interruption of timeout in worker shutdown diff --git a/packages/platform-bun/src/internal/worker.ts b/packages/platform-bun/src/internal/worker.ts index ffe95beaa6b..37e4a30372e 100644 --- a/packages/platform-bun/src/internal/worker.ts +++ b/packages/platform-bun/src/internal/worker.ts @@ -19,8 +19,8 @@ const platformWorkerImpl = Worker.makePlatform()({ worker.postMessage([1]) return Deferred.await(closeDeferred) }).pipe( - Effect.interruptible, Effect.timeout(5000), + Effect.interruptible, Effect.catchAllCause(() => Effect.sync(() => worker.terminate())) ) ), diff --git a/packages/platform-node/src/internal/worker.ts b/packages/platform-node/src/internal/worker.ts index 5b5aaa554cd..61b7f211121 100644 --- a/packages/platform-node/src/internal/worker.ts +++ b/packages/platform-node/src/internal/worker.ts @@ -20,8 +20,8 @@ const platformWorkerImpl = Worker.makePlatform()({ worker.postMessage([1]) return Deferred.await(exitDeferred) }).pipe( - Effect.interruptible, Effect.timeout(5000), + Effect.interruptible, Effect.catchAllCause(() => Effect.sync(() => worker.terminate())) ) ),