From c1725442eab391648ce11fd2d5f3b63d20e4e0f7 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 30 Aug 2018 17:03:42 -0400 Subject: [PATCH] added progress bar to username_email_history upgrade script --- src/upgrades/1.10.2/username_email_history.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/upgrades/1.10.2/username_email_history.js b/src/upgrades/1.10.2/username_email_history.js index a3f6fcc347..1aea342b4b 100644 --- a/src/upgrades/1.10.2/username_email_history.js +++ b/src/upgrades/1.10.2/username_email_history.js @@ -10,6 +10,8 @@ module.exports = { name: 'Record first entry in username/email history', timestamp: Date.UTC(2018, 7, 28), method: function (callback) { + const progress = this.progress; + batch.processSortedSet('users:joindate', function (ids, next) { async.each(ids, function (uid, next) { async.parallel([ @@ -55,8 +57,13 @@ module.exports = { }, ], next); }, - ], next); + ], function (err) { + progress.incr(); + setImmediate(next, err); + }); }, next); + }, { + progress: this.progress, }, callback); }, };