From 121a1ff5da119f1067e3bde1294a946c858deb29 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 27 Feb 2024 11:58:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=BF=AB=E7=85=A7=20j?= =?UTF-8?q?son=20=E6=96=87=E4=BB=B6=E7=94=9F=E6=88=90=E9=80=BB=E8=BE=91=20?= =?UTF-8?q?(#3993)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/snapshot.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/app/service/snapshot.go b/backend/app/service/snapshot.go index 1b57a484d..66c0e404f 100644 --- a/backend/app/service/snapshot.go +++ b/backend/app/service/snapshot.go @@ -234,6 +234,7 @@ func (u *SnapshotService) SnapshotRecover(req dto.SnapshotRecover) error { } isReTry = false } + _ = u.saveJson(snapJson, u.OriginalPath) _, _ = cmd.Exec("systemctl stop docker") if !isReTry || snap.InterruptStep == "DockerDir" { @@ -244,6 +245,7 @@ func (u *SnapshotService) SnapshotRecover(req dto.SnapshotRecover) error { isReTry = false } } else { + _ = u.saveJson(snapJson, u.OriginalPath) if !isReTry || snap.InterruptStep == "DockerDir" { if err := u.handleDockerDatasWithSave(fileOp, operation, rootDir, ""); err != nil { updateRecoverStatus(snap.ID, "DockerDir", constant.StatusFailed, err.Error()) @@ -252,7 +254,6 @@ func (u *SnapshotService) SnapshotRecover(req dto.SnapshotRecover) error { isReTry = false } } - _ = u.saveJson(snapJson, u.OriginalPath) if !isReTry || snap.InterruptStep == "DaemonJson" { if err := u.handleDaemonJson(fileOp, operation, rootDir+"/docker/daemon.json", u.OriginalPath); err != nil {