for simplicity keep the cutoff time the same while flushing the queue

This commit is contained in:
Brian Gough 2019-09-26 15:05:38 +01:00
parent eae4b352ca
commit a709a0adaa

View file

@ -22,6 +22,7 @@ async = require "async"
module.exports = DeleteQueueManager =
flushAndDeleteOldProjects: (options, callback) ->
startTime = Date.now()
cutoffTime = startTime - options.min_delete_age
count = 0
flushProjectIfNotModified = (project_id, flushTimestamp, cb) ->
@ -49,7 +50,6 @@ module.exports = DeleteQueueManager =
if count > options.limit
logger.log "hit count limit on flushing old projects"
return callback()
cutoffTime = now - options.min_delete_age
RedisManager.getNextProjectToFlushAndDelete cutoffTime, (err, project_id, flushTimestamp, queueLength) ->
return callback(err) if err?
return callback() if !project_id?