Merge pull request #160 from pierotofy/corrupt

Bug fixes
pull/162/head
Piero Toffanin 2021-06-21 11:00:06 -04:00 zatwierdzone przez GitHub
commit bb8b7bda5c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 23 dodań i 4 usunięć

Wyświetl plik

@ -158,7 +158,8 @@ class TaskManager{
try{
tasks = JSON.parse(data.toString());
}catch(e){
done(new Error(`Could not load task list. It looks like the ${TASKS_DUMP_FILE} is corrupted (${e.message}). Please manually delete the file and try again.`));
logger.warn(`Could not load task list. It looks like the ${TASKS_DUMP_FILE} is corrupted (${e.message}).`);
if (done !== undefined) done();
return;
}

Wyświetl plik

@ -290,8 +290,26 @@ module.exports = {
// Move all uploads to data/<uuid>/images dir (if any)
cb => fs.mkdir(destPath, undefined, cb),
cb => fs.mkdir(destGcpPath, undefined, cb),
cb => mv(srcPath, destImagesPath, cb),
cb => {
// We attempt to do this multiple times,
// as antivirus software sometimes is scanning
// the folder while we try to move it, resulting in
// an operation not permitted error
let retries = 0;
const move = () => {
mv(srcPath, destImagesPath, err => {
if (!err) cb(); // Done
else{
if (++retries < 20){
logger.warn(`Cannot move ${srcPath}, probably caused by antivirus software (please disable it or add an exception), retrying (${retries})...`);
setTimeout(2000, move);
}else cb(err);
}
});
}
move();
},
// Zip files handling
cb => {
const handleSeed = (cb) => {

Wyświetl plik

@ -1,6 +1,6 @@
{
"name": "NodeODM",
"version": "2.1.8",
"version": "2.1.9",
"description": "REST API to access ODM",
"main": "index.js",
"scripts": {