Update locks error logging (#9768)
* Fix intermittent backend-core migration test failure * Update lock logging
This commit is contained in:
parent
e3b1204472
commit
19c86fa738
|
@ -85,17 +85,20 @@ export const doWithLock = async (opts: LockOptions, task: any) => {
|
||||||
const result = await task()
|
const result = await task()
|
||||||
return result
|
return result
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.log("lock error")
|
console.warn("lock error")
|
||||||
// lock limit exceeded
|
// lock limit exceeded
|
||||||
if (e.name === "LockError") {
|
if (e.name === "LockError") {
|
||||||
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
|
||||||
|
console.warn(e)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
console.error(e)
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
console.error(e)
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|
Loading…
Reference in New Issue