tasks: add completed flag

in some cases, the tasks are setting percent to 100 and crashing later
This commit is contained in:
Girish Ramakrishnan
2025-07-16 15:22:00 +02:00
parent 54c2e670e1
commit b42be9899e
5 changed files with 31 additions and 11 deletions
+2 -1
View File
@@ -110,7 +110,8 @@ async function main() {
const [runError, result] = await safe(TASKS[task.type].apply(null, task.args.concat(progressCallback)));
const progress = {
result: result || null,
error: runError ? JSON.parse(JSON.stringify(runError, Object.getOwnPropertyNames(runError))) : null
error: runError ? JSON.parse(JSON.stringify(runError, Object.getOwnPropertyNames(runError))) : null,
percent: 100
};
debug(`Task took ${(new Date() - startTime)/1000} seconds`);