From 04c7292e44a9ad272543ff241dad72af4ce5ccaa Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 21 Jul 2023 21:35:47 -0400 Subject: [PATCH] fix: remove mutex and don't make cb async to prevent race condition --- src/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 0daea8d..564176d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -165,8 +165,7 @@ function handleSocketListenEvent(aq: ActiveQuery) { aq.respond(); }; - const cb = async (data: Buffer) => { - await socket.mutex?.waitForUnlock(); + const cb = (data: Buffer) => { if (responded) { return; }