Update locks error logging (#9768)
* Fix intermittent backend-core migration test failure * Update lock logging
This commit is contained in:
parent
1e0e3ce19e
commit
6a88cfc32d
|
@ -85,17 +85,20 @@ export const doWithLock = async (opts: LockOptions, task: any) => {
|
|||
const result = await task()
|
||||
return result
|
||||
} catch (e: any) {
|
||||
console.log("lock error")
|
||||
console.warn("lock error")
|
||||
// lock limit exceeded
|
||||
if (e.name === "LockError") {
|
||||
if (opts.type === LockType.TRY_ONCE) {
|
||||
// don't throw for try-once locks, they will always error
|
||||
// due to retry count (0) exceeded
|
||||
console.warn(e)
|
||||
return
|
||||
} else {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
} else {
|
||||
console.error(e)
|
||||
throw e
|
||||
}
|
||||
} finally {
|
||||
|
|
Loading…
Reference in New Issue