mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
feat: 升级时暂停计划任务 (#2274)
This commit is contained in:
parent
65662b2e84
commit
7b4b0bddff
@ -104,6 +104,10 @@ func (u *UpgradeService) Upgrade(req dto.Upgrade) error {
|
||||
fileName := fmt.Sprintf("1panel-%s-%s-%s.tar.gz", req.Version, "linux", itemArch)
|
||||
_ = settingRepo.Update("SystemStatus", "Upgrading")
|
||||
go func() {
|
||||
_ = global.Cron.Stop()
|
||||
defer func() {
|
||||
global.Cron.Start()
|
||||
}()
|
||||
if err := fileOp.DownloadFile(downloadPath+"/"+fileName, rootDir+"/"+fileName); err != nil {
|
||||
global.LOG.Errorf("download service file failed, err: %v", err)
|
||||
_ = settingRepo.Update("SystemStatus", "Free")
|
||||
|
@ -2,10 +2,11 @@ package migrations
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/1Panel-dev/1Panel/backend/app/service"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/1Panel-dev/1Panel/backend/app/service"
|
||||
|
||||
"github.com/1Panel-dev/1Panel/backend/app/model"
|
||||
"github.com/1Panel-dev/1Panel/backend/app/repo"
|
||||
"github.com/1Panel-dev/1Panel/backend/constant"
|
||||
@ -705,6 +706,7 @@ var UpdateDatabase = &gormigrate.Migration{
|
||||
"app_install_id": mysqlInfo.ID,
|
||||
"name": mysqlInfo.Name,
|
||||
"password": pass,
|
||||
"port": service.DatabaseKeys["mysql"],
|
||||
"address": mysqlInfo.ServiceName,
|
||||
}).Error; err != nil {
|
||||
global.LOG.Errorf("updata database %s info failed, err: %v", data.Name, err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user