From 0d53fbe7fae5164f8bf90b9ede2dc08724898d7c Mon Sep 17 00:00:00 2001 From: Alan Mosko Date: Tue, 17 Jan 2023 11:49:49 -0300 Subject: [PATCH] Update make-mutex.ts --- src/Utils/make-mutex.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Utils/make-mutex.ts b/src/Utils/make-mutex.ts index a632caa..8bb9f54 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,11 +6,6 @@ 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 { @@ -50,4 +41,4 @@ export const makeKeyedMutex = () => { return map[key].mutex(task) } } -} +} \ No newline at end of file