fix: 解决同步任务状态导致启动失败的问题 (#3268)

This commit is contained in:
zhengkunwang 2023-12-11 16:24:06 +08:00 committed by GitHub
parent a2c16e6a54
commit e48c224c41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View file

@ -12,7 +12,6 @@ import (
"github.com/1Panel-dev/1Panel/backend/buserr" "github.com/1Panel-dev/1Panel/backend/buserr"
"github.com/1Panel-dev/1Panel/backend/constant" "github.com/1Panel-dev/1Panel/backend/constant"
"github.com/1Panel-dev/1Panel/backend/global" "github.com/1Panel-dev/1Panel/backend/global"
"github.com/1Panel-dev/1Panel/backend/i18n"
cmd2 "github.com/1Panel-dev/1Panel/backend/utils/cmd" cmd2 "github.com/1Panel-dev/1Panel/backend/utils/cmd"
"github.com/1Panel-dev/1Panel/backend/utils/compose" "github.com/1Panel-dev/1Panel/backend/utils/compose"
"github.com/1Panel-dev/1Panel/backend/utils/docker" "github.com/1Panel-dev/1Panel/backend/utils/docker"
@ -576,7 +575,7 @@ func (r *RuntimeService) SyncForRestart() error {
for _, runtime := range runtimes { for _, runtime := range runtimes {
if runtime.Status == constant.RuntimeBuildIng || runtime.Status == constant.RuntimeReCreating || runtime.Status == constant.RuntimeStarting || runtime.Status == constant.RuntimeCreating { if runtime.Status == constant.RuntimeBuildIng || runtime.Status == constant.RuntimeReCreating || runtime.Status == constant.RuntimeStarting || runtime.Status == constant.RuntimeCreating {
runtime.Status = constant.SystemRestart runtime.Status = constant.SystemRestart
runtime.Message = i18n.GetMsgByKey("SystemRestart") runtime.Message = "System restart causing interrupt"
_ = runtimeRepo.Save(&runtime) _ = runtimeRepo.Save(&runtime)
} }
} }

View file

@ -495,7 +495,7 @@ func (w WebsiteSSLService) SyncForRestart() error {
for _, ssl := range sslList { for _, ssl := range sslList {
if ssl.Status == constant.SSLApply { if ssl.Status == constant.SSLApply {
ssl.Status = constant.SystemRestart ssl.Status = constant.SystemRestart
ssl.Message = i18n.GetMsgByKey("SystemRestart") ssl.Message = "System restart causing interrupt"
_ = websiteSSLRepo.Save(&ssl) _ = websiteSSLRepo.Save(&ssl)
} }
} }