mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-26 14:40:57 +03:00
Fixed issue where restoring a DB backup would cause backup_local_db task to be stuck running
Slightly updated tasks UI
This commit is contained in:
@@ -110,7 +110,8 @@ exports.executeTask = async (task_key) => {
|
||||
|
||||
exports.executeRun = async (task_key) => {
|
||||
logger.verbose(`Running task ${task_key}`);
|
||||
await db_api.updateRecord('tasks', {key: task_key}, {running: true});
|
||||
// don't set running to true when backup up DB as it will be stick "running" if restored
|
||||
if (task_key !== 'backup_local_db') await db_api.updateRecord('tasks', {key: task_key}, {running: true});
|
||||
const data = await TASKS[task_key].run();
|
||||
await db_api.updateRecord('tasks', {key: task_key}, {data: data, last_ran: Date.now()/1000, running: false});
|
||||
logger.verbose(`Finished running task ${task_key}`);
|
||||
|
||||
Reference in New Issue
Block a user