1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

fix: 修改快照版本判断 (#1862)

This commit is contained in:
ssongliu 2023-08-07 15:10:26 +08:00 committed by GitHub
parent c326606401
commit 7721395748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -303,8 +303,8 @@ func (u *SnapshotService) SnapshotRecover(req dto.SnapshotRecover) error {
recoverPanelDir := fmt.Sprintf("%s/%s/1panel", baseDir, snap.Name)
liveRestore := false
if !isReTry && !isNewSnapshot {
if snap.InterruptStep == "LoadDockerJson" {
if !isNewSnapshot {
if !isReTry || snap.InterruptStep == "LoadDockerJson" {
snapJson.OldDockerDataDir, liveRestore, err = u.loadDockerDataDir()
if err != nil {
updateRecoverStatus(snap.ID, "LoadDockerJson", constant.StatusFailed, fmt.Sprintf("load docker data dir failed, err: %v", err))
@ -322,7 +322,7 @@ func (u *SnapshotService) SnapshotRecover(req dto.SnapshotRecover) error {
_ = u.saveJson(snapJson, rootDir)
_, _ = cmd.Exec("systemctl stop docker")
if snap.InterruptStep == "DockerDir" {
if !isReTry || snap.InterruptStep == "DockerDir" {
if err := u.handleDockerDatas(fileOp, operation, rootDir, snapJson.DockerDataDir); err != nil {
updateRecoverStatus(snap.ID, "DockerDir", constant.StatusFailed, err.Error())
return