1
0
Fork 0
mirror of synced 2024-10-02 18:16:29 +13:00

Add message

This commit is contained in:
Adria Navarro 2024-03-07 11:30:03 +01:00
parent fe33b97ecd
commit 9e55f87d02

View file

@ -2,6 +2,7 @@ import { AnyDocument, Database } from "@budibase/types"
import { JobQueue, createQueue } from "../queue"
import * as dbUtils from "../db"
import { logWarn } from "../logging"
interface ProcessDocMessage {
dbName: string
@ -26,6 +27,7 @@ class DocWritethroughProcessor {
await this.persistToDb(message.data)
} catch (err: any) {
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.
throw new Error(`Conflict persisting message ${message.id}`)
}