From 33fadf51c1a8aa103d711db41c6931d4e0283244 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 30 Sep 2019 13:41:47 +0100 Subject: [PATCH] fix getDocTimestamps for multiple docs --- services/document-updater/app/coffee/RedisManager.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/document-updater/app/coffee/RedisManager.coffee b/services/document-updater/app/coffee/RedisManager.coffee index 1490ac87f4..842f5d545b 100644 --- a/services/document-updater/app/coffee/RedisManager.coffee +++ b/services/document-updater/app/coffee/RedisManager.coffee @@ -4,6 +4,7 @@ logger = require('logger-sharelatex') metrics = require('./Metrics') Errors = require "./Errors" crypto = require "crypto" +async = require "async" ProjectHistoryRedisManager = require "./ProjectHistoryRedisManager" # Sometimes Redis calls take an unexpectedly long time. We have to be @@ -289,10 +290,9 @@ module.exports = RedisManager = getDocTimestamps: (doc_ids, callback = (error, result) ->) -> # get lastupdatedat timestamps for an array of doc_ids - multi = rclient.multi() - for doc_id in doc_ids - multi.get keys.lastUpdatedAt(doc_id: doc_id) - multi.exec callback + async.mapSeries doc_ids, (doc_id, cb) -> + rclient.get keys.lastUpdatedAt(doc_id: doc_id), cb + , callback queueFlushAndDeleteProject: (project_id, callback) -> # store the project id in a sorted set ordered by time