From 8b0d73b5d56ac4e8eac9641bb78e30c2d1e41e77 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:52:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=A4=87=E4=BB=BD=E4=B8=8B=E8=BD=BD=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98=20(#3743?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/cronjob_backup.go | 11 ++++------- frontend/src/views/cronjob/operate/index.vue | 9 ++++++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/backend/app/service/cronjob_backup.go b/backend/app/service/cronjob_backup.go index 1c56893f7..7da0accb4 100644 --- a/backend/app/service/cronjob_backup.go +++ b/backend/app/service/cronjob_backup.go @@ -43,15 +43,15 @@ func (u *CronjobService) handleApp(cronjob model.Cronjob, startTime time.Time) e if err := handleAppBackup(&app, backupDir, record.FileName); err != nil { return err } - if err := backupRepo.CreateRecord(&record); err != nil { - global.LOG.Errorf("save backup record failed, err: %v", err) - return err - } downloadPath, err := u.uploadCronjobBackFile(cronjob, accountMap, path.Join(backupDir, record.FileName)) if err != nil { return err } record.FileDir = path.Dir(downloadPath) + if err := backupRepo.CreateRecord(&record); err != nil { + global.LOG.Errorf("save backup record failed, err: %v", err) + return err + } u.removeExpiredBackup(cronjob, accountMap, record) } return nil @@ -121,7 +121,6 @@ func (u *CronjobService) handleDatabase(cronjob model.Cronjob, startTime time.Ti return err } record.FileDir = path.Dir(downloadPath) - if err := backupRepo.CreateRecord(&record); err != nil { global.LOG.Errorf("save backup record failed, err: %v", err) return err @@ -153,7 +152,6 @@ func (u *CronjobService) handleDirectory(cronjob model.Cronjob, startTime time.T } record.FileDir = path.Dir(downloadPath) record.FileName = fileName - if err := backupRepo.CreateRecord(&record); err != nil { global.LOG.Errorf("save backup record failed, err: %v", err) return err @@ -184,7 +182,6 @@ func (u *CronjobService) handleSystemLog(cronjob model.Cronjob, startTime time.T } record.FileDir = path.Dir(downloadPath) record.FileName = fileName - if err := backupRepo.CreateRecord(&record); err != nil { global.LOG.Errorf("save backup record failed, err: %v", err) return err diff --git a/frontend/src/views/cronjob/operate/index.vue b/frontend/src/views/cronjob/operate/index.vue index 1a4d459ed..8646d7274 100644 --- a/frontend/src/views/cronjob/operate/index.vue +++ b/frontend/src/views/cronjob/operate/index.vue @@ -253,7 +253,7 @@ multiple class="selectClass" v-model="dialogData.rowData!.backupAccountList" - @change="changeAccount" + @change="changeAccount(true)" >