mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 05:55:48 +01:00
adding progress bar to session deletion upgrade script
This commit is contained in:
@@ -11,6 +11,7 @@ module.exports = {
|
|||||||
method: function (callback) {
|
method: function (callback) {
|
||||||
var configJSON = require.main.require('./config.json');
|
var configJSON = require.main.require('./config.json');
|
||||||
var isRedisSessionStore = configJSON.hasOwnProperty('redis');
|
var isRedisSessionStore = configJSON.hasOwnProperty('redis');
|
||||||
|
var progress = this.progress;
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function (next) {
|
function (next) {
|
||||||
@@ -22,7 +23,10 @@ module.exports = {
|
|||||||
client.keys('sess:*', next);
|
client.keys('sess:*', next);
|
||||||
},
|
},
|
||||||
function (sessionKeys, next) {
|
function (sessionKeys, next) {
|
||||||
|
progress.total = sessionKeys.length;
|
||||||
|
|
||||||
async.eachSeries(sessionKeys, function (key, next) {
|
async.eachSeries(sessionKeys, function (key, next) {
|
||||||
|
progress.incr();
|
||||||
client.del(key, next);
|
client.del(key, next);
|
||||||
}, next);
|
}, next);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user