This commit is contained in:
Tiger Wang 2022-11-19 13:42:28 +00:00
parent b8d00aa07c
commit 8f6797ec8a

View File

@ -55,10 +55,8 @@ func init() {
service.Cache = cache.Init() service.Cache = cache.Init()
service.GetToken()
service.GetCPUThermalZone() service.GetCPUThermalZone()
service.NewVersionApp = make(map[string]string)
route.InitFunction() route.InitFunction()
// go service.LoopFriend() // go service.LoopFriend()
@ -111,7 +109,7 @@ func main() {
if err != nil { if err != nil {
panic(err) panic(err)
} }
routers := []string{"sys", "apps", "container", "app-categories", "port", "file", "folder", "batch", "image", "samba", "notify"} routers := []string{"sys", "container", "app-categories", "port", "file", "folder", "batch", "image", "samba", "notify"}
for _, v := range routers { for _, v := range routers {
err = service.MyService.Gateway().CreateRoute(&model.Route{ err = service.MyService.Gateway().CreateRoute(&model.Route{
Path: "/v1/" + v, Path: "/v1/" + v,
@ -138,9 +136,8 @@ func main() {
}() }()
urlFilePath := filepath.Join(config.CommonInfo.RuntimePath, "casaos.url") urlFilePath := filepath.Join(config.CommonInfo.RuntimePath, "casaos.url")
err = file.CreateFileAndWriteContent(urlFilePath, "http://"+listener.Addr().String()) if err := file.CreateFileAndWriteContent(urlFilePath, "http://"+listener.Addr().String()); err != nil {
if err != nil { loger.Error("error when creating address file", zap.Error(err),
loger.Error("Management service is listening...",
zap.Any("address", listener.Addr().String()), zap.Any("address", listener.Addr().String()),
zap.Any("filepath", urlFilePath), zap.Any("filepath", urlFilePath),
) )