return failed and succesfully flushed projects when flushing everything

This commit is contained in:
Henry Oswald 2019-06-13 14:21:38 +01:00
parent 6eba954b52
commit d9a737f97c

View file

@ -56,8 +56,15 @@ ProjectFlusher =
jobs = _.map project_ids, (project_id)-> jobs = _.map project_ids, (project_id)->
return (cb)-> return (cb)->
ProjectManager.flushAndDeleteProjectWithLocks project_id, cb ProjectManager.flushAndDeleteProjectWithLocks project_id, cb
async.parallelLimit jobs, options.concurrency, (error)-> async.parallelLimit async.reflectAll(jobs), options.concurrency, (error, results)->
return callback(error, project_ids) success = []
failure = []
_.each results, (result, i)->
if result.error?
failure.push(project_ids[i])
else
success.push(project_ids[i])
return callback(error, {success:success, failure:failure})
module.exports = ProjectFlusher module.exports = ProjectFlusher