backups: fix app restore with tgz
This commit is contained in:
@@ -70,6 +70,7 @@ async function setupNetworking() {
|
||||
// 50 - internal error , 70 - SIGTERM exit
|
||||
function exitSync(status) {
|
||||
if (status.error) fs.write(logFd, status.error.stack + '\n', function () {});
|
||||
fs.write(logFd, `Exiting with code ${status.code}\n`, function () {});
|
||||
fs.fsyncSync(logFd);
|
||||
fs.closeSync(logFd);
|
||||
process.exit(status.code);
|
||||
@@ -127,10 +128,11 @@ async function main() {
|
||||
percent: 100
|
||||
};
|
||||
|
||||
await safe(tasks.setCompleted(taskId, progress), { debug });
|
||||
|
||||
debug(`Task took ${(new Date() - startTime)/1000} seconds`);
|
||||
|
||||
await safe(tasks.setCompleted(taskId, progress), { debug });
|
||||
exitSync({ error: runError, code: runError instanceof BoxError ? 0 : 50 }); // handled error vs run time crash
|
||||
exitSync({ error: runError, code: (!runError || runError instanceof BoxError) ? 0 : 50 }); // handled error vs run time crash
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
Reference in New Issue
Block a user