Browse Source

fix: 解决快照恢复失败的问题 (#5739)

pull/5743/head
ssongliu 5 months ago committed by GitHub
parent
commit
5f2cfe6e20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      backend/app/dto/container.go
  2. 2
      backend/app/service/snapshot_recover.go

2
backend/app/dto/container.go

@ -8,7 +8,7 @@ type PageContainer struct {
PageInfo
Name string `json:"name"`
State string `json:"state" validate:"required,oneof=all created running paused restarting removing exited dead"`
OrderBy string `json:"orderBy" validate:"required,oneof=name status created_at"`
OrderBy string `json:"orderBy" validate:"required,oneof=name state created_at"`
Order string `json:"order" validate:"required,oneof=null ascending descending"`
Filters string `json:"filters"`
ExcludeAppStore bool `json:"excludeAppStore"`

2
backend/app/service/snapshot_recover.go

@ -74,7 +74,7 @@ func (u *SnapshotService) HandleSnapshotRecover(snap model.Snapshot, isRecover b
req.IsNew = true
}
if isRecover && (req.IsNew || snap.InterruptStep == "AppData") {
if err := recoverAppData(snapFileDir); err == nil {
if err := recoverAppData(snapFileDir); err != nil {
updateRecoverStatus(snap.ID, isRecover, "DockerDir", constant.StatusFailed, fmt.Sprintf("handle recover app data failed, err: %v", err))
return
}

Loading…
Cancel
Save