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 {