Fixed concurrency on hash creation.
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
parent
4f1d72147a
commit
e0bf69faef
@ -248,12 +248,12 @@ function processBlock(items) {
|
|||||||
lastMessage = moment();
|
lastMessage = moment();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}, {
|
}, {
|
||||||
concurrency: 5
|
concurrency: 5
|
||||||
}).catch(function(error) {
|
}).catch(function(error) {
|
||||||
console.log("Error commiting HASH transactions");
|
console.log("Error commiting HASH transactions");
|
||||||
throw error;
|
throw error;
|
||||||
});
|
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
let toProcess = needsProcessing.length, lastMessage = moment();
|
let toProcess = needsProcessing.length, lastMessage = moment();
|
||||||
console.log(needsProcessing.length + " assets need to have metadata extracted");
|
console.log(needsProcessing.length + " assets need to have metadata extracted");
|
||||||
@ -682,7 +682,7 @@ module.exports = {
|
|||||||
((Date.now() - now) / 1000) + "s");
|
((Date.now() - now) / 1000) + "s");
|
||||||
now = Date.now();
|
now = Date.now();
|
||||||
|
|
||||||
console.log(albums.length + " assets remaining to have DB entries updated. ETA N/A");
|
console.log(assets.length + " assets remaining to have DB entries updated. ETA N/A");
|
||||||
|
|
||||||
let processed = 0, start = Date.now(), last = 0, updateScanned = [];
|
let processed = 0, start = Date.now(), last = 0, updateScanned = [];
|
||||||
return photoDB.sequelize.transaction(function(transaction) {
|
return photoDB.sequelize.transaction(function(transaction) {
|
||||||
@ -693,9 +693,6 @@ module.exports = {
|
|||||||
} else {
|
} else {
|
||||||
updateScanned.push(asset.id);
|
updateScanned.push(asset.id);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}, {
|
|
||||||
concurrency: 10
|
|
||||||
}).then(function(asset) {
|
}).then(function(asset) {
|
||||||
processed++;
|
processed++;
|
||||||
|
|
||||||
@ -710,6 +707,9 @@ module.exports = {
|
|||||||
last = processed;
|
last = processed;
|
||||||
start = Date.now();
|
start = Date.now();
|
||||||
});
|
});
|
||||||
|
}, {
|
||||||
|
concurrency: 10
|
||||||
|
});
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
if (updateScanned.length) {
|
if (updateScanned.length) {
|
||||||
return photoDB.sequelize.query("UPDATE photos SET scanned=CURRENT_TIMESTAMP WHERE id IN (:ids)", {
|
return photoDB.sequelize.query("UPDATE photos SET scanned=CURRENT_TIMESTAMP WHERE id IN (:ids)", {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user