mirror of https://github.com/1Panel-dev/1Panel
feat: 删除 AppStoreVersion 参数 (#1217)
parent
d40b2734a9
commit
80599a3576
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/1Panel-dev/1Panel/backend/i18n"
|
||||
"github.com/1Panel-dev/1Panel/backend/utils/files"
|
||||
"gopkg.in/yaml.v3"
|
||||
"math"
|
||||
|
@ -344,10 +345,10 @@ func (a *AppInstallService) SyncAll(systemInit bool) error {
|
|||
return err
|
||||
}
|
||||
for _, i := range allList {
|
||||
if i.Status == constant.Installing {
|
||||
if i.Status == constant.Installing || i.Status == constant.Upgrading {
|
||||
if systemInit {
|
||||
i.Status = constant.Error
|
||||
i.Message = "System restart causes application exception"
|
||||
i.Message = i18n.GetMsgByKey("ErrAppSystemRestart")
|
||||
_ = appInstallRepo.Save(context.Background(), &i)
|
||||
}
|
||||
continue
|
||||
|
|
|
@ -38,6 +38,7 @@ ErrFileParseApp: 'Failed to parse {{.name}} file {{.err}}'
|
|||
ErrAppDirNull: 'version folder does not exist'
|
||||
LocalAppErr: "App {{.name}} sync failed! {{.err}}"
|
||||
ErrContainerName: "ContainerName is already exist"
|
||||
ErrAppSystemRestart: "1Panel restart causes the task to terminate"
|
||||
|
||||
#file
|
||||
ErrFileCanNotRead: "File can not read"
|
||||
|
|
|
@ -38,6 +38,7 @@ ErrFileParseApp: '{{.name}} 文件解析失败 {{.err}}'
|
|||
ErrAppDirNull: '版本文件夹不存在'
|
||||
LocalAppErr: "应用 {{.name}} 同步失败!{{.err}}"
|
||||
ErrContainerName: "容器名称已存在"
|
||||
ErrAppSystemRestart: "1Panel 重启导致任务终止"
|
||||
|
||||
#file
|
||||
ErrFileCanNotRead: "此文件不支持预览"
|
||||
|
|
|
@ -16,7 +16,7 @@ func syncApp() {
|
|||
global.LOG.Errorf("sync app error: %s", err.Error())
|
||||
return
|
||||
}
|
||||
if setting.AppStoreVersion != "" {
|
||||
if setting.AppStoreLastModified != "0" {
|
||||
global.LOG.Info("no need to sync")
|
||||
return
|
||||
}
|
||||
|
|
|
@ -23,10 +23,8 @@ var versionCmd = &cobra.Command{
|
|||
return err
|
||||
}
|
||||
version := getSettingByKey(db, "SystemVersion")
|
||||
appStoreVersion := getSettingByKey(db, "AppStoreVersion")
|
||||
|
||||
fmt.Printf("1panel version: %s\n", version)
|
||||
fmt.Printf("appstore version: %s\n", appStoreVersion)
|
||||
config := configs.ServerConfig{}
|
||||
if err := yaml.Unmarshal(conf.AppYaml, &config); err != nil {
|
||||
return fmt.Errorf("unmarshal conf.App.Yaml failed, errL %v", err)
|
||||
|
|
Loading…
Reference in New Issue