Delete info on process
This commit is contained in:
parent
a9046e9f26
commit
8e8378d1be
|
@ -108,4 +108,13 @@ export default class BaseCache {
|
||||||
throw err
|
throw err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete the entry if the provided value matches the stored one.
|
||||||
|
*/
|
||||||
|
async deleteIfValue(key: string, value: any, opts = { useTenancy: true }) {
|
||||||
|
key = opts.useTenancy ? generateTenantKey(key) : key
|
||||||
|
const client = await this.getClient()
|
||||||
|
await client.deleteIfValue(key, value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,11 @@ docWritethroughProcessorQueue.process(async message => {
|
||||||
|
|
||||||
await persistToDb(cache, message.data)
|
await persistToDb(cache, message.data)
|
||||||
console.log("DocWritethrough persisted", { data: message.data })
|
console.log("DocWritethrough persisted", { data: message.data })
|
||||||
|
|
||||||
|
await cache.deleteIfValue(
|
||||||
|
REDIS_KEYS(cacheKeyPrefix).LATEST_MESSAGE_ID,
|
||||||
|
latestMessageId
|
||||||
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue