with delayed queue to manage orders which didn‘t pay in the normalOrderOvertime of order setting #201
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题
之前通过定时器去定时检查超时时间之前下的订单,如果没支付则取消该订单,不能保证未支付订单在相同的时间内被取消订单,例如有的是15分钟未支付就被取消订单,有的是20分钟,因离定时器的时间而不同;
解决办法
将订单放入到延时队列,在orderSetting设定的一般订单的实效时间,对未支付的订单进行取消,可以实现未支付的订单在相同的时间内会被取消。