mirror of
https://github.com/wassname/talk.git
synced 2026-08-15 12:55:10 +08:00
fix: addressed issue with count doubling (#2518)
This commit is contained in:
committed by
Kim Gardner
parent
ac1ed45e4b
commit
0fad1070a6
@@ -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], [])
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user