refactor: pr feedbacks
This commit is contained in:
parent
3e66a37804
commit
417e33f935
2 changed files with 6 additions and 2 deletions
|
|
@ -16,7 +16,9 @@ export class BackupExecutionJob extends Job {
|
||||||
logger.info(`Found ${scheduleIds.length} backup schedule(s) to execute`);
|
logger.info(`Found ${scheduleIds.length} backup schedule(s) to execute`);
|
||||||
|
|
||||||
for (const scheduleId of scheduleIds) {
|
for (const scheduleId of scheduleIds) {
|
||||||
backupsService.executeBackup(scheduleId);
|
backupsService.executeBackup(scheduleId).catch((err) => {
|
||||||
|
logger.error(`Error executing backup for schedule ${scheduleId}:`, err);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return { done: true, timestamp: new Date(), executed: scheduleIds.length };
|
return { done: true, timestamp: new Date(), executed: scheduleIds.length };
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,9 @@ export const backupScheduleController = new Hono()
|
||||||
.post("/:scheduleId/run", runBackupNowDto, async (c) => {
|
.post("/:scheduleId/run", runBackupNowDto, async (c) => {
|
||||||
const scheduleId = c.req.param("scheduleId");
|
const scheduleId = c.req.param("scheduleId");
|
||||||
|
|
||||||
backupsService.executeBackup(Number(scheduleId), true);
|
backupsService.executeBackup(Number(scheduleId), true).catch((err) => {
|
||||||
|
console.error(`Error executing manual backup for schedule ${scheduleId}:`, err);
|
||||||
|
});
|
||||||
|
|
||||||
return c.json<RunBackupNowDto>({ success: true }, 200);
|
return c.json<RunBackupNowDto>({ success: true }, 200);
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue