Show progress while processing albums
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
parent
8f16c0337c
commit
dd329dfd75
@ -663,8 +663,15 @@ module.exports = {
|
|||||||
* Operating in parallel could result in a child being searched for prior to the parent */
|
* Operating in parallel could result in a child being searched for prior to the parent */
|
||||||
now = Date.now();
|
now = Date.now();
|
||||||
|
|
||||||
|
let toProcess = albums.length, lastMessage = moment();
|
||||||
return Promise.mapSeries(albums, function(album) {
|
return Promise.mapSeries(albums, function(album) {
|
||||||
return findOrCreateDBAlbum(album);
|
return findOrCreateDBAlbum(album).then(function() {
|
||||||
|
toProcess--;
|
||||||
|
if (moment().add(-5, 'seconds') > lastMessage) {
|
||||||
|
console.log("Albums to be created in DB: " + toProcess);
|
||||||
|
lastMessage = moment();
|
||||||
|
}
|
||||||
|
});
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
console.log("Processed " + albums.length + " album DB entries in " +
|
console.log("Processed " + albums.length + " album DB entries in " +
|
||||||
((Date.now() - now) / 1000) + "s");
|
((Date.now() - now) / 1000) + "s");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user