tasks: add pending field

this indicates if a task is scheduled. previously, we relied
on task.progress being 1
This commit is contained in:
Girish Ramakrishnan
2025-06-17 15:50:48 +02:00
parent 89cfe1ef57
commit 4770b32287
3 changed files with 19 additions and 12 deletions
+2 -2
View File
@@ -33,8 +33,8 @@ const TASKS = { // indexed by task type
syncDyndns: dyndns.sync,
updateDiskUsage: system.updateDiskUsage,
_identity: async (arg, progressCallback) => { progressCallback({}); return arg; },
_error: async (arg, progressCallback) => { progressCallback({}); throw new Error(`Failed for arg: ${arg}`); },
_identity: async (arg, progressCallback) => { progressCallback({ percent: 20 }); return arg; },
_error: async (arg, progressCallback) => { progressCallback({ percent: 20 }); throw new Error(`Failed for arg: ${arg}`); },
_crash: (arg) => { throw new Error(`Crashing for arg: ${arg}`); }, // the test looks for this debug string in the log file
_sleep: async (arg) => setTimeout(process.exit, arg)
};