Undo
This commit is contained in:
parent
17b06703e9
commit
536422e60b
|
@ -82,11 +82,6 @@ type SuccessfulRedlockExecution<T> = {
|
||||||
}
|
}
|
||||||
type UnsuccessfulRedlockExecution = {
|
type UnsuccessfulRedlockExecution = {
|
||||||
executed: false
|
executed: false
|
||||||
reason: UnsuccessfulRedlockExecutionReason
|
|
||||||
}
|
|
||||||
|
|
||||||
export const enum UnsuccessfulRedlockExecutionReason {
|
|
||||||
LockTakenWithTryOnce = "LOCK_TAKEN_WITH_TRY_ONCE",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type RedlockExecution<T> =
|
type RedlockExecution<T> =
|
||||||
|
@ -146,10 +141,7 @@ export async function doWithLock<T>(
|
||||||
if (opts.type === LockType.TRY_ONCE) {
|
if (opts.type === LockType.TRY_ONCE) {
|
||||||
// don't throw for try-once locks, they will always error
|
// don't throw for try-once locks, they will always error
|
||||||
// due to retry count (0) exceeded
|
// due to retry count (0) exceeded
|
||||||
return {
|
return { executed: false }
|
||||||
executed: false,
|
|
||||||
reason: UnsuccessfulRedlockExecutionReason.LockTakenWithTryOnce,
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue