|
|
@@ -16,6 +16,7 @@ import (
|
|
|
)
|
|
|
|
|
|
var wechatOrderShippingLock sync.Mutex
|
|
|
+var wechatOrderShippingLocation = time.FixedZone("CST", 8*60*60)
|
|
|
|
|
|
type WechatOrderShippingResult struct {
|
|
|
StartedAt string `json:"started_at"`
|
|
|
@@ -51,8 +52,9 @@ func StartWechatOrderShippingScheduler() {
|
|
|
}
|
|
|
|
|
|
func nextWechatOrderShippingRun(now time.Time) time.Time {
|
|
|
- next := time.Date(now.Year(), now.Month(), now.Day(), 1, 3, 0, 0, now.Location())
|
|
|
- if !next.After(now) {
|
|
|
+ beijingNow := now.In(wechatOrderShippingLocation)
|
|
|
+ next := time.Date(beijingNow.Year(), beijingNow.Month(), beijingNow.Day(), 10, 3, 0, 0, wechatOrderShippingLocation)
|
|
|
+ if !next.After(beijingNow) {
|
|
|
next = next.AddDate(0, 0, 1)
|
|
|
}
|
|
|
return next
|