From acf727c70f6f0f63fc0aef528423e52553445ed3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 29 May 2023 14:44:23 +0200 Subject: [PATCH] refactor: cleanup async lock acquire() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils/AsyncLock.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/AsyncLock.ts b/src/utils/AsyncLock.ts index 229086fe..cf0443b2 100644 --- a/src/utils/AsyncLock.ts +++ b/src/utils/AsyncLock.ts @@ -19,11 +19,11 @@ export class AsyncLock { const asyncLock = AsyncLock.getAsyncLock(type); if (!asyncLock.acquired) { asyncLock.acquired = true; - } else { - return new Promise((resolve) => { - asyncLock.resolveQueue.push(resolve); - }); + return; } + return new Promise((resolve) => { + asyncLock.resolveQueue.push(resolve); + }); } public static async release(type: AsyncLockType): Promise { -- 2.34.1