- 添加对于监控平台门店状态初始版本
This commit is contained in:
@@ -16,6 +16,16 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
)
|
||||
|
||||
func Init() {
|
||||
StartRefreshEbaiRealMobile()
|
||||
StartDailyWork()
|
||||
if globals.ReallyCallPlatformAPI {
|
||||
ScheduleTimerFunc(func() {
|
||||
cms.SaveAndSendAlarmVendorSnapshot(jxcontext.AdminCtx, nil, nil)
|
||||
}, cms.WatchVendorStoreTimeList)
|
||||
}
|
||||
}
|
||||
|
||||
func StartRefreshEbaiRealMobile() {
|
||||
if globals.ReallyCallPlatformAPI {
|
||||
utils.AfterFuncWithRecover(5*time.Second, func() {
|
||||
@@ -144,3 +154,14 @@ func doDailyWork() {
|
||||
// cms.CurVendorSync.FullSyncStoresSkus(jxcontext.AdminCtx, dao.GetDB(), []int{model.VendorIDJD}, nil, true, true)
|
||||
cms.CurVendorSync.SyncStoresSkus(jxcontext.AdminCtx, dao.GetDB(), []int{model.VendorIDJD, model.VendorIDEBAI, model.VendorIDMTWM}, nil, nil, false, true, true)
|
||||
}
|
||||
|
||||
func ScheduleTimerFunc(handler func(), timeList []string) {
|
||||
now := time.Now()
|
||||
nextTime := jxutils.GetNextTimeFromList(now, timeList)
|
||||
duration := nextTime.Sub(now) + 1*time.Second
|
||||
globals.SugarLogger.Debugf("ScheduleTimerFunc, duration:%v", duration)
|
||||
utils.AfterFuncWithRecover(duration, func() {
|
||||
handler()
|
||||
ScheduleTimerFunc(handler, timeList)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user