mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +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)
|
fileName := fmt.Sprintf("1panel-%s-%s-%s.tar.gz", req.Version, "linux", itemArch)
|
||||||
_ = settingRepo.Update("SystemStatus", "Upgrading")
|
_ = settingRepo.Update("SystemStatus", "Upgrading")
|
||||||
go func() {
|
go func() {
|
||||||
|
_ = global.Cron.Stop()
|
||||||
|
defer func() {
|
||||||
|
global.Cron.Start()
|
||||||
|
}()
|
||||||
if err := fileOp.DownloadFile(downloadPath+"/"+fileName, rootDir+"/"+fileName); err != nil {
|
if err := fileOp.DownloadFile(downloadPath+"/"+fileName, rootDir+"/"+fileName); err != nil {
|
||||||
global.LOG.Errorf("download service file failed, err: %v", err)
|
global.LOG.Errorf("download service file failed, err: %v", err)
|
||||||
_ = settingRepo.Update("SystemStatus", "Free")
|
_ = settingRepo.Update("SystemStatus", "Free")
|
||||||
|
@ -2,10 +2,11 @@ package migrations
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/1Panel-dev/1Panel/backend/app/service"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/app/service"
|
||||||
|
|
||||||
"github.com/1Panel-dev/1Panel/backend/app/model"
|
"github.com/1Panel-dev/1Panel/backend/app/model"
|
||||||
"github.com/1Panel-dev/1Panel/backend/app/repo"
|
"github.com/1Panel-dev/1Panel/backend/app/repo"
|
||||||
"github.com/1Panel-dev/1Panel/backend/constant"
|
"github.com/1Panel-dev/1Panel/backend/constant"
|
||||||
@ -705,6 +706,7 @@ var UpdateDatabase = &gormigrate.Migration{
|
|||||||
"app_install_id": mysqlInfo.ID,
|
"app_install_id": mysqlInfo.ID,
|
||||||
"name": mysqlInfo.Name,
|
"name": mysqlInfo.Name,
|
||||||
"password": pass,
|
"password": pass,
|
||||||
|
"port": service.DatabaseKeys["mysql"],
|
||||||
"address": mysqlInfo.ServiceName,
|
"address": mysqlInfo.ServiceName,
|
||||||
}).Error; err != nil {
|
}).Error; err != nil {
|
||||||
global.LOG.Errorf("updata database %s info failed, err: %v", data.Name, err)
|
global.LOG.Errorf("updata database %s info failed, err: %v", data.Name, err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user