2022-11-23 09:44:24 +00:00
|
|
|
package business
|
|
|
|
|
|
|
|
import (
|
2023-02-17 09:19:35 +00:00
|
|
|
"fmt"
|
2022-11-23 09:44:24 +00:00
|
|
|
"github.com/1Panel-dev/1Panel/backend/app/service"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/global"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Init() {
|
2023-02-13 07:38:09 +00:00
|
|
|
setting, err := service.NewISettingService().GetSettingInfo()
|
|
|
|
if err != nil {
|
|
|
|
global.LOG.Errorf("sync app error: %s", err.Error())
|
2023-02-17 09:19:35 +00:00
|
|
|
return
|
2023-02-13 07:38:09 +00:00
|
|
|
}
|
2023-02-17 08:21:13 +00:00
|
|
|
if setting.AppStoreVersion != "" {
|
2023-02-17 09:19:35 +00:00
|
|
|
fmt.Println(setting.AppStoreVersion)
|
|
|
|
global.LOG.Info("do not sync")
|
2023-02-13 07:38:09 +00:00
|
|
|
return
|
|
|
|
}
|
2023-02-17 09:19:35 +00:00
|
|
|
global.LOG.Info("sync app start...")
|
2023-02-13 07:46:14 +00:00
|
|
|
if err := service.NewIAppService().SyncAppList(); err != nil {
|
2022-11-23 09:44:24 +00:00
|
|
|
global.LOG.Errorf("sync app error: %s", err.Error())
|
|
|
|
}
|
2023-02-17 09:19:35 +00:00
|
|
|
global.LOG.Info("sync app success")
|
2022-11-23 09:44:24 +00:00
|
|
|
}
|