From ebb9a6c7529ad8702d7ceebb17961337ae2fa57c Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 23 Mar 2017 11:50:46 +0000 Subject: [PATCH] Improve logging --- migrations/5_remove_holding_accounts.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/migrations/5_remove_holding_accounts.coffee b/migrations/5_remove_holding_accounts.coffee index 1b503656c6..687b1ee3b7 100644 --- a/migrations/5_remove_holding_accounts.coffee +++ b/migrations/5_remove_holding_accounts.coffee @@ -60,16 +60,17 @@ module.exports = HoldingAccountMigration = callback() run: (done = () ->) -> + console.log "[Getting list of holding accounts]" HoldingAccountMigration.findHoldingAccounts (error, users) -> throw error if error? - console.log "[Got list of holding accounts]", users.map (u) -> u._id + console.log "[Got #{users.length} holding accounts]" jobs = users.map (u) -> (cb) -> HoldingAccountMigration.deleteUser u._id, (error) -> return cb(error) if error? HoldingAccountMigration.deleteUserProjects u._id, (error) -> return cb(error) if error? - setTimeout cb, 200 # Small delay to not hammer DB + setTimeout cb, 50 # Small delay to not hammer DB async.series jobs, (error) -> throw error if error? console.log "[FINISHED]"