通过延时队列实现检查订单是否已经超期,自动取消订单的功能 #275
Merged
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.
延时队列检查订单是否已经超期
目前通过定时检查订单未付款情况,如果超时自动取消订单,这种实现的问题就是无法准确时间内取消订单。通过java自带的延时队列,可以准确的实现取消订单的功能,当然如果允许Redis,或者mq也可以在分布式的环境中实现统一的延时队列。项目中定时任务都可以使用延时队列实现准时的任务操作。