巴扎黑2017-04-17 15:09:37
2 sets of plans:
Plan 1: Self-closing:
is to add a closing operation in the two stages of browsing the product and the customer browsing the order. Roughly speaking, every time you browse a product, you will find all unpaid orders for the product, which were created less than 15 minutes ago. . Close and add inventory; browse your order page and close all your orders placed 15 minutes ago~~
Option 2: Scheduled shutdown of the system:
Every time an order is created, a command is pushed to the queue to be executed in 15 minutes, and the command is closed after the payment is completed.
If this command is still alive after 15 minutes, then check the corresponding order. If payment has not been made, close it~
This is the plan. Mysql itself cannot implement the timing function.
But you need 2 sets of detailed sql statements for the plan. . Let’s ask again. It’s relatively simple and the needs are different, so I won’t bother to comment