From 7b4b0bddff090b8d84efbf8aff062b50bc8224ab Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Wed, 13 Sep 2023 15:54:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8D=87=E7=BA=A7=E6=97=B6=E6=9A=82?= =?UTF-8?q?=E5=81=9C=E8=AE=A1=E5=88=92=E4=BB=BB=E5=8A=A1=20(#2274)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/upgrade.go | 4 ++++ backend/init/migration/migrations/init.go | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/app/service/upgrade.go b/backend/app/service/upgrade.go index e400b542f..2a3daf0d7 100644 --- a/backend/app/service/upgrade.go +++ b/backend/app/service/upgrade.go @@ -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") diff --git a/backend/init/migration/migrations/init.go b/backend/init/migration/migrations/init.go index a00cbea38..9b5fdbd62 100644 --- a/backend/init/migration/migrations/init.go +++ b/backend/init/migration/migrations/init.go @@ -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)