diff --git a/packages/backend-core/src/redis/redlockImpl.ts b/packages/backend-core/src/redis/redlockImpl.ts index dec8aad032..a4586a4495 100644 --- a/packages/backend-core/src/redis/redlockImpl.ts +++ b/packages/backend-core/src/redis/redlockImpl.ts @@ -13,13 +13,7 @@ async function getClient( if (type === LockType.CUSTOM) { return newRedlock(opts) } - if ( - env.isTest() && - type !== LockType.TRY_ONCE && - type !== LockType.AUTO_EXTEND - ) { - return newRedlock(OPTIONS.TEST) - } + switch (type) { case LockType.TRY_ONCE: { return newRedlock(OPTIONS.TRY_ONCE) @@ -42,7 +36,7 @@ async function getClient( } } -const OPTIONS: Record = { +const OPTIONS: Record = { TRY_ONCE: { // immediately throws an error if the lock is already held retryCount: 0, @@ -50,11 +44,6 @@ const OPTIONS: Record = { TRY_TWICE: { retryCount: 1, }, - TEST: { - // higher retry count in unit tests - // due to high contention. - retryCount: 100, - }, DEFAULT: { // the expected clock drift; for more details // see http://redis.io/topics/distlock