From 2a68b81cc1eb3236fb1c35971c20ade0b6c24b17 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 20 Apr 2017 14:32:23 +0100 Subject: [PATCH] randomise order of flush --- services/track-changes/app/coffee/UpdatesManager.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/services/track-changes/app/coffee/UpdatesManager.coffee b/services/track-changes/app/coffee/UpdatesManager.coffee index f3571dc16d..48423a39ec 100644 --- a/services/track-changes/app/coffee/UpdatesManager.coffee +++ b/services/track-changes/app/coffee/UpdatesManager.coffee @@ -150,6 +150,7 @@ module.exports = UpdatesManager = return callback(error) if error? logger.log {count: project_ids?.length, project_ids: project_ids}, "found projects" jobs = [] + project_ids = _.shuffle project_ids # randomise to avoid hitting same projects each time selectedProjects = if limit < 0 then project_ids else project_ids[0...limit] for project_id in selectedProjects do (project_id) ->