diff --git a/backend/tasks.js b/backend/tasks.js index 9fdbad3..423f85a 100644 --- a/backend/tasks.js +++ b/backend/tasks.js @@ -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}`); diff --git a/src/app/components/tasks/tasks.component.html b/src/app/components/tasks/tasks.component.html index 9baa503..f883f54 100644 --- a/src/app/components/tasks/tasks.component.html +++ b/src/app/components/tasks/tasks.component.html @@ -34,9 +34,9 @@ Status - + Scheduled for  - {{element.next_invocation | date: 'short'}}repeat + {{element.next_invocation | date: 'short'}}repeat Not scheduled @@ -58,10 +58,10 @@ -
+
-
+
diff --git a/src/app/dialogs/restore-db-dialog/restore-db-dialog.component.ts b/src/app/dialogs/restore-db-dialog/restore-db-dialog.component.ts index 77df326..204a8c1 100644 --- a/src/app/dialogs/restore-db-dialog/restore-db-dialog.component.ts +++ b/src/app/dialogs/restore-db-dialog/restore-db-dialog.component.ts @@ -31,14 +31,18 @@ export class RestoreDbDialogComponent implements OnInit { } restoreClicked(): void { + this.restoring = true; if (this.selected_backup.length !== 1) return; this.postsService.restoreDBBackup(this.selected_backup[0]).subscribe(res => { + this.restoring = false; if (res['success']) { this.postsService.openSnackBar('Database successfully restored!'); + this.dialogRef.close(); } else { this.postsService.openSnackBar('Failed to restore database! See logs for more info.'); } }, err => { + this.restoring = false; this.postsService.openSnackBar('Failed to restore database! See browser console for more info.'); console.error(err); });