From 4fc26a306111fb304230b449ddff3c6322ed6cbb Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:56:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E5=90=8E=E5=A4=87=E4=BB=BD=E6=95=B0=E6=8D=AE=E6=9C=AA=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E7=9A=84=E9=97=AE=E9=A2=98=20(#3837)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/init/migration/migrations/v_1_9.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/init/migration/migrations/v_1_9.go b/backend/init/migration/migrations/v_1_9.go index 2b78ade00..d3404c4be 100644 --- a/backend/init/migration/migrations/v_1_9.go +++ b/backend/init/migration/migrations/v_1_9.go @@ -316,7 +316,7 @@ var UpdateCronjobSpec = &gormigrate.Migration{ var records []model.JobRecords _ = tx.Where("cronjob_id = ?", job.ID).Find(&records).Error for _, record := range records { - if job.Type == "snapshot" && job.Status == constant.StatusSuccess { + if job.Type == "snapshot" && record.Status == constant.StatusSuccess { var snaps []model.Snapshot _ = tx.Where("name like ?", "snapshot_"+"%").Find(&snaps).Error for _, snap := range snaps { @@ -337,7 +337,7 @@ var UpdateCronjobSpec = &gormigrate.Migration{ } continue } - if job.Type == "log" && job.Status == constant.StatusSuccess { + if job.Type == "log" && record.Status == constant.StatusSuccess { item := model.BackupRecord{ From: "cronjob", CronjobID: job.ID, @@ -354,7 +354,7 @@ var UpdateCronjobSpec = &gormigrate.Migration{ _ = tx.Create(&item).Error continue } - if job.Type == "directory" && job.Status == constant.StatusSuccess { + if job.Type == "directory" && record.Status == constant.StatusSuccess { item := model.BackupRecord{ From: "cronjob", CronjobID: job.ID,