1
0
Fork 0
mirror of synced 2024-07-04 22:11:23 +12:00
This commit is contained in:
Adria Navarro 2024-03-07 11:23:09 +01:00
parent 17b06703e9
commit 536422e60b

View file

@ -82,11 +82,6 @@ type SuccessfulRedlockExecution<T> = {
}
type UnsuccessfulRedlockExecution = {
executed: false
reason: UnsuccessfulRedlockExecutionReason
}
export const enum UnsuccessfulRedlockExecutionReason {
LockTakenWithTryOnce = "LOCK_TAKEN_WITH_TRY_ONCE",
}
type RedlockExecution<T> =
@ -146,10 +141,7 @@ export async function doWithLock<T>(
if (opts.type === LockType.TRY_ONCE) {
// don't throw for try-once locks, they will always error
// due to retry count (0) exceeded
return {
executed: false,
reason: UnsuccessfulRedlockExecutionReason.LockTakenWithTryOnce,
}
return { executed: false }
} else {
throw e
}