From ba35c73cb65491e2d579492626b987d7c84a88d0 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 26 Sep 2019 15:18:10 +0100 Subject: [PATCH] add comment about ZPOPMIN --- services/document-updater/app/coffee/RedisManager.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/services/document-updater/app/coffee/RedisManager.coffee b/services/document-updater/app/coffee/RedisManager.coffee index 7f62fe1e7e..1490ac87f4 100644 --- a/services/document-updater/app/coffee/RedisManager.coffee +++ b/services/document-updater/app/coffee/RedisManager.coffee @@ -305,6 +305,7 @@ module.exports = RedisManager = return callback() if !reply?.length # return if no projects ready to be processed # pop the oldest entry (get and remove in a multi) multi = rclient.multi() + # Poor man's version of ZPOPMIN, which is only available in Redis 5. multi.zrange keys.flushAndDeleteQueue(), 0, 0, "WITHSCORES" multi.zremrangebyrank keys.flushAndDeleteQueue(), 0, 0 multi.zcard keys.flushAndDeleteQueue() # the total length of the queue (for metrics)