2023-06-02 14:23:24 +08:00
|
|
|
package job
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/app/service"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/global"
|
|
|
|
)
|
|
|
|
|
|
|
|
type app struct{}
|
|
|
|
|
|
|
|
func NewAppStoreJob() *app {
|
|
|
|
return &app{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *app) Run() {
|
|
|
|
global.LOG.Info("AppStore scheduled task in progress ...")
|
2025-02-20 13:29:04 +08:00
|
|
|
appService := service.NewIAppService()
|
|
|
|
if err := appService.SyncAppListFromRemote(); err != nil {
|
2023-06-02 14:23:24 +08:00
|
|
|
global.LOG.Errorf("AppStore sync failed %s", err.Error())
|
|
|
|
}
|
2025-02-20 13:29:04 +08:00
|
|
|
appService.SyncAppListFromLocal()
|
2023-06-02 14:23:24 +08:00
|
|
|
global.LOG.Info("AppStore scheduled task has completed")
|
|
|
|
}
|