From 5efb0ebbea19b7f3d783fbc1589fa0e9c1386ff5 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Fri, 13 Jan 2023 10:20:28 +0530 Subject: [PATCH] chore: remove mutex-start log --- src/Utils/make-mutex.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/Utils/make-mutex.ts b/src/Utils/make-mutex.ts index 1b1d70b..278fe75 100644 --- a/src/Utils/make-mutex.ts +++ b/src/Utils/make-mutex.ts @@ -1,7 +1,3 @@ -import logger from './logger' - -const MUTEX_TIMEOUT_MS = 60_000 - export const makeMutex = () => { let task = Promise.resolve() as Promise @@ -10,19 +6,12 @@ export const makeMutex = () => { return { mutex(code: () => Promise | T): Promise { task = (async() => { - const stack = new Error('mutex start').stack - let waitOver = false - taskTimeout = setTimeout(() => { - logger.warn({ stack, waitOver }, 'possible mutex deadlock') - }, MUTEX_TIMEOUT_MS) // wait for the previous task to complete // if there is an error, we swallow so as to not block the queue try { await task } catch{ } - waitOver = true - try { // execute the current task const result = await code()