style: 启动1panel,自动同步应用

This commit is contained in:
zhengkunwang223 2022-11-23 17:44:24 +08:00 committed by zhengkunwang223
parent d8971b05c1
commit c111290609
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,13 @@
package business
import (
"github.com/1Panel-dev/1Panel/backend/app/service"
"github.com/1Panel-dev/1Panel/backend/global"
)
func Init() {
appService := service.AppService{}
if err := appService.SyncAppList(); err != nil {
global.LOG.Errorf("sync app error: %s", err.Error())
}
}

View File

@ -4,6 +4,7 @@ import (
"encoding/gob"
"fmt"
"github.com/1Panel-dev/1Panel/backend/init/app"
"github.com/1Panel-dev/1Panel/backend/init/business"
"time"
"github.com/1Panel-dev/1Panel/backend/cron"
@ -35,6 +36,7 @@ func Start() {
session.Init()
gin.SetMode(global.CONF.System.Level)
cron.Run()
business.Init()
rootRouter := router.Routers()
address := fmt.Sprintf(":%d", global.CONF.System.Port)