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