Просмотр исходного кода

add random jitter to cutoff time

Brian Gough 7 лет назад
Родитель
Сommit
2c22a60052
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      services/document-updater/app/coffee/DeleteQueueManager.coffee

+ 1 - 1
services/document-updater/app/coffee/DeleteQueueManager.coffee

@@ -23,7 +23,7 @@ async = require "async"
 module.exports = DeleteQueueManager =
     flushAndDeleteOldProjects: (options, callback) ->
         startTime = Date.now()
-        cutoffTime = startTime - options.min_delete_age 
+        cutoffTime = startTime - options.min_delete_age + 100 * (Math.random() - 0.5)
         count = 0
 
         flushProjectIfNotModified = (project_id, flushTimestamp, cb) ->