Trigger cleanup job for a site
This commit is contained in:
@@ -77,9 +77,8 @@ async function onStartBackup(site) {
|
||||
const [error, result] = await backupSitesModels.createBackup(site.id);
|
||||
if (error) {
|
||||
if (error.status === 409) {
|
||||
// TODO
|
||||
// if (error.body.message.indexOf('full_backup') !== -1) startBackupError.value = 'Backup already in progress. Please retry later.';
|
||||
// else startBackupError.value = 'App task is currently in progress. Please retry later.';
|
||||
if (error.body.message.indexOf('full_backup') !== -1) window.pankow.notify({ text: 'Backup already in progress. Please retry later.', type: 'danger' });
|
||||
else window.pankow.notify({ text: 'App task is currently in progress. Please retry later.', type: 'danger' });
|
||||
}
|
||||
|
||||
return console.error(error);
|
||||
@@ -94,7 +93,15 @@ async function onStartBackup(site) {
|
||||
}
|
||||
|
||||
async function onStartCleanup(site) {
|
||||
const [error, result] = await backupSitesModels.cleanup(site.id);
|
||||
if (error) return console.error(error);
|
||||
|
||||
const [taskError, task] = await tasksModel.get(result);
|
||||
if (taskError) return console.error(taskError);
|
||||
|
||||
site.task = task;
|
||||
|
||||
setTimeout(waitForSiteTask.bind(null,site), 2000);
|
||||
}
|
||||
|
||||
const actionMenuModel = ref([]);
|
||||
|
||||
Reference in New Issue
Block a user