From 5a7dbb00764131b4b312531b064b794041bf2665 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 29 Nov 2023 18:20:54 +0100 Subject: [PATCH] Async --- packages/backend-core/src/redis/redlockImpl.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/src/redis/redlockImpl.ts b/packages/backend-core/src/redis/redlockImpl.ts index 048d17d080..9a6b200c81 100644 --- a/packages/backend-core/src/redis/redlockImpl.ts +++ b/packages/backend-core/src/redis/redlockImpl.ts @@ -118,8 +118,8 @@ export async function doWithLock( if (!opts.ttl) { // No TTL is provided, so we keep extending the lock while the task is running - interval = setInterval(() => { - lock?.extend(ttl / 2) + interval = setInterval(async () => { + await lock?.extend(ttl / 2) }, ttl / 2) }