Add message
This commit is contained in:
parent
fe33b97ecd
commit
9e55f87d02
|
@ -2,6 +2,7 @@ import { AnyDocument, Database } from "@budibase/types"
|
||||||
|
|
||||||
import { JobQueue, createQueue } from "../queue"
|
import { JobQueue, createQueue } from "../queue"
|
||||||
import * as dbUtils from "../db"
|
import * as dbUtils from "../db"
|
||||||
|
import { logWarn } from "../logging"
|
||||||
|
|
||||||
interface ProcessDocMessage {
|
interface ProcessDocMessage {
|
||||||
dbName: string
|
dbName: string
|
||||||
|
@ -26,6 +27,7 @@ class DocWritethroughProcessor {
|
||||||
await this.persistToDb(message.data)
|
await this.persistToDb(message.data)
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err.status === 409) {
|
if (err.status === 409) {
|
||||||
|
logWarn(`409 conflict in doc-writethrough cache`)
|
||||||
// If we get a 409, it means that another job updated it meanwhile. We want to retry it to persist it again.
|
// If we get a 409, it means that another job updated it meanwhile. We want to retry it to persist it again.
|
||||||
throw new Error(`Conflict persisting message ${message.id}`)
|
throw new Error(`Conflict persisting message ${message.id}`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue