refactor: pr feedbacks

This commit is contained in:
Nicolas Meienberger 2025-12-19 19:22:15 +01:00
parent 3e66a37804
commit 417e33f935
2 changed files with 6 additions and 2 deletions

View file

@ -16,7 +16,9 @@ export class BackupExecutionJob extends Job {
logger.info(`Found ${scheduleIds.length} backup schedule(s) to execute`);
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 };

View file

@ -86,7 +86,9 @@ export const backupScheduleController = new Hono()
.post("/:scheduleId/run", runBackupNowDto, async (c) => {
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);
})