Stop the process when expire-channels is done

This commit is contained in:
yflory
2018-02-15 11:33:31 +01:00
parent f004c4d701
commit ef0c08130d
2 changed files with 11 additions and 2 deletions

View File

@@ -78,7 +78,7 @@ nt = nThen(function (w) {
store = _store;
}));
}).nThen(function () {
dirs.forEach(function (dir) {
dirs.forEach(function (dir, dIdx) {
queue(function (w) {
console.log('recursing into %s', dir);
Fs.readdir(Path.join(root, dir), w(function (e, list) {
@@ -98,6 +98,11 @@ nt = nThen(function (w) {
});
});
});
if (dIdx === (dirs.length - 1)) {
queue(function () {
store.shutdown();
});
}
}));
});
});