Skip to content

Commit

Permalink
fix: 解决 cloudreve 升级数据丢失的问题 (#1822)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkunwang223 authored Aug 3, 2023
1 parent b831472 commit 40d3392
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions backend/app/service/app_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,10 @@ func upgradeInstall(installId uint, detailId uint, backup bool) error {
detailDir = path.Join(constant.ResourceDir, "apps", "local", strings.TrimPrefix(install.App.Key, "local"), detail.Version)
}

cmd := exec.Command("/bin/bash", "-c", fmt.Sprintf("cp -rf %s/* %s", detailDir, install.GetPath()))
stdout, err := cmd.CombinedOutput()
if err != nil {
if stdout != nil {
upErr = errors.New(string(stdout))
return
}
upErr = err
return
cmd := exec.Command("/bin/bash", "-c", fmt.Sprintf("cp -rn %s/* %s || true", detailDir, install.GetPath()))
stdout, _ := cmd.CombinedOutput()
if stdout != nil {
global.LOG.Errorf("upgrade app [%s] [%s] cp file log : %s ", install.App.Key, install.Name, string(stdout))
}

composeMap := make(map[string]interface{})
Expand Down

0 comments on commit 40d3392

Please sign in to comment.