diff --git a/src/core/server/models/story/counts/shared.ts b/src/core/server/models/story/counts/shared.ts index b40039bfd..fe369bf99 100644 --- a/src/core/server/models/story/counts/shared.ts +++ b/src/core/server/models/story/counts/shared.ts @@ -106,8 +106,10 @@ export async function recalculateSharedModerationQueueQueueCounts( // Increment the hash key values. const pipeline = redis.pipeline(); - // Mark the key as fresh, and update the values! - pipeline.mhincrby( + // Mark the key as fresh, and update the values! We're using `HMSET` here + // because this can still result in race conditions when the call is made + // twice. + pipeline.hmset( key, ...queues.reduce((acc, queue) => [...acc, queue._id, queue.total], []) );