mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-18 13:29:03 +08:00
fix: Fix version upgrade failure in some scenarios
This commit is contained in:
parent
9424d061fa
commit
6f9a8d5afe
1 changed files with 2 additions and 2 deletions
|
|
@ -156,13 +156,13 @@ func (u *UpgradeService) Upgrade(req dto.Upgrade) error {
|
|||
|
||||
global.LOG.Info("backup original data successful, now start to upgrade!")
|
||||
|
||||
if err := files.CopyFileWithRename(path.Join(tmpDir, "1panel-core"), "/usr/local/bin/1panel-core.tmp"); err != nil {
|
||||
if err := files.CopyFileWithRename(path.Join(tmpDir, "1panel-core"), "/usr/local/bin/1panel-core"); err != nil {
|
||||
global.LOG.Errorf("upgrade 1panel-core failed, err: %v", err)
|
||||
_ = settingRepo.Update("SystemStatus", "Free")
|
||||
u.handleRollback(originalDir, 1)
|
||||
return
|
||||
}
|
||||
if err := files.CopyFileWithRename(path.Join(tmpDir, "1panel-agent"), "/usr/local/bin/1panel-agent.tmp"); err != nil {
|
||||
if err := files.CopyFileWithRename(path.Join(tmpDir, "1panel-agent"), "/usr/local/bin/1panel-agent"); err != nil {
|
||||
global.LOG.Errorf("upgrade 1panel-agent failed, err: %v", err)
|
||||
_ = settingRepo.Update("SystemStatus", "Free")
|
||||
u.handleRollback(originalDir, 1)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue