From df54ea94781a0a699e10e96831b131fcb5263eaf Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 15 Mar 2019 10:53:57 +0800 Subject: [PATCH] - remove duplicated cms const storeDeliveryTypeName - change misc.Init to StartRefreshEbaiRealMobile and make it async to minimize startup time --- business/jxcallback/scheduler/scheduler.go | 7 +------ business/jxstore/cms/cms.go | 2 -- business/jxstore/misc/misc.go | 6 ++++-- business/model/store.go | 2 +- main.go | 2 +- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/business/jxcallback/scheduler/scheduler.go b/business/jxcallback/scheduler/scheduler.go index f1fb373b5..a1f5002e8 100644 --- a/business/jxcallback/scheduler/scheduler.go +++ b/business/jxcallback/scheduler/scheduler.go @@ -27,12 +27,7 @@ const ( ) var ( - CurrentScheduler IScheduler - StoreDeliveryTypeName = map[int]string{ - StoreDeliveryTypeCrowdSourcing: "平台众包", - StoreDeliveryTypeByPlatform: "平台专送", - StoreDeliveryTypeByStore: "商家自送", - } + CurrentScheduler IScheduler ) var ( diff --git a/business/jxstore/cms/cms.go b/business/jxstore/cms/cms.go index 1754ddb1b..4d7f25690 100644 --- a/business/jxstore/cms/cms.go +++ b/business/jxstore/cms/cms.go @@ -6,7 +6,6 @@ import ( "strconv" "git.rosy.net.cn/baseapi/utils" - "git.rosy.net.cn/jx-callback/business/jxcallback/scheduler" "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" "git.rosy.net.cn/jx-callback/business/jxutils/tasksch" "git.rosy.net.cn/jx-callback/business/model" @@ -44,7 +43,6 @@ func InitServiceInfo(version, buildDate, gitCommit string) { "bankName": model.BankName, "promotionStatusName": model.PromotionStatusName, "orderTypeName": model.OrderTypeName, - "storeDeliveryTypeName": scheduler.StoreDeliveryTypeName, "taskStatusName": tasksch.TaskStatusName, "opRequestTypeName": model.RequestTypeName, "opRequestStatusName": model.RequestStatusName, diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index 8c5cc2a2a..144566e91 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -8,8 +8,10 @@ import ( "git.rosy.net.cn/jx-callback/business/partner/purchase/ebai" ) -func Init() { - RefreshEbaiRealMobile() +func StartRefreshEbaiRealMobile() { + utils.AfterFuncWithRecover(5*time.Second, func() { + RefreshEbaiRealMobile() + }) } func RefreshEbaiRealMobile() { diff --git a/business/model/store.go b/business/model/store.go index f70922f46..06e52e98c 100644 --- a/business/model/store.go +++ b/business/model/store.go @@ -39,7 +39,7 @@ var ( DeliveryRangeTypeRadius: "圆", } DeliveryTypeName = map[int]string{ - StoreDeliveryTypeCrowdSourcing: "平台众包配送", + StoreDeliveryTypeCrowdSourcing: "平台众包", StoreDeliveryTypeByPlatform: "平台专送", StoreDeliveryTypeByStore: "门店自送", } diff --git a/main.go b/main.go index 036e32585..f3196e715 100644 --- a/main.go +++ b/main.go @@ -38,7 +38,7 @@ func Init() { api.Init() cms.InitServiceInfo(Version, BuildDate, GitCommit) promotion.Init() - misc.Init() + misc.StartRefreshEbaiRealMobile() ebai.CurPurchaseHandler.StartRefreshComment() }