remove unnecessary check

This commit is contained in:
Brian Gough 2019-09-26 14:59:03 +01:00
parent 9f358ead9f
commit eae4b352ca
2 changed files with 2 additions and 2 deletions

View file

@ -31,7 +31,7 @@ module.exports = DeleteQueueManager =
logger.log {project_id}, "skipping flush of queued project - no timestamps"
return cb()
# are any of the timestamps newer than the time the project was flushed?
for timestamp in timestamps or [] when timestamp > flushTimestamp
for timestamp in timestamps when timestamp > flushTimestamp
metrics.inc "queued-delete-skipped"
logger.debug {project_id, timestamps, flushTimestamp}, "found newer timestamp, will skip delete"
return cb()

View file

@ -83,7 +83,7 @@ module.exports = ProjectManager =
getProjectDocsTimestamps: (project_id, callback = (error) ->) ->
RedisManager.getDocIdsInProject project_id, (error, doc_ids) ->
return callback(error) if error?
return callback() if !doc_ids?.length
return callback(null, []) if !doc_ids?.length
RedisManager.getDocTimestamps doc_ids, (error, timestamps) ->
return callback(error) if error?
callback(null, timestamps)