2022-11-23 17:44:24 +08:00
|
|
|
package business
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/app/service"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/global"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Init() {
|
2023-10-09 15:46:27 +08:00
|
|
|
go syncApp()
|
|
|
|
go syncInstalledApp()
|
2023-03-20 10:38:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func syncApp() {
|
2023-04-08 14:02:14 +08:00
|
|
|
if err := service.NewIAppService().SyncAppListFromRemote(); err != nil {
|
2023-10-09 15:46:27 +08:00
|
|
|
global.LOG.Errorf("App Store synchronization failed")
|
2023-03-20 10:38:39 +08:00
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func syncInstalledApp() {
|
|
|
|
if err := service.NewIAppInstalledService().SyncAll(true); err != nil {
|
|
|
|
global.LOG.Errorf("sync instaled app error: %s", err.Error())
|
2022-11-23 17:44:24 +08:00
|
|
|
}
|
|
|
|
}
|