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