- 非生产环境不限制GetMsg的等待时间
This commit is contained in:
@@ -125,10 +125,12 @@ func GetMsg(ctx *jxcontext.Context, storeID int, lastOrderTime time.Time, lastOr
|
|||||||
pollingDuration := defPollingDuration
|
pollingDuration := defPollingDuration
|
||||||
if waitingSecond != 0 {
|
if waitingSecond != 0 {
|
||||||
pollingDuration = time.Duration(waitingSecond) * time.Second
|
pollingDuration = time.Duration(waitingSecond) * time.Second
|
||||||
if pollingDuration > maxPollingDuration {
|
if globals.IsProductEnv() {
|
||||||
pollingDuration = maxPollingDuration
|
if pollingDuration > maxPollingDuration {
|
||||||
} else if pollingDuration < minPollingDuration {
|
pollingDuration = maxPollingDuration
|
||||||
pollingDuration = minPollingDuration
|
} else if pollingDuration < minPollingDuration {
|
||||||
|
pollingDuration = minPollingDuration
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
timer := time.NewTimer(pollingDuration)
|
timer := time.NewTimer(pollingDuration)
|
||||||
|
|||||||
@@ -77,3 +77,7 @@ func Init() {
|
|||||||
func IsCallbackAlwaysReturnSuccess() bool {
|
func IsCallbackAlwaysReturnSuccess() bool {
|
||||||
return beego.BConfig.RunMode == "beta"
|
return beego.BConfig.RunMode == "beta"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsProductEnv() bool {
|
||||||
|
return beego.BConfig.RunMode == "prod" || beego.BConfig.RunMode == "jxgy"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user