From 6a47001a221de03757b765582c4e466424c77b16 Mon Sep 17 00:00:00 2001 From: AriPerkkio Date: Sun, 20 Aug 2023 13:46:24 +0300 Subject: [PATCH] fix: `setTimeout` causes process hangs --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 591c843..cb15cae 100644 --- a/src/index.ts +++ b/src/index.ts @@ -182,7 +182,7 @@ export function createBirpc( setTimeout(() => { reject(new Error(`[birpc] timeout on calling "${method}"`)) rpcPromiseMap.delete(id) - }, timeout) + }, timeout).unref?.() } }) }