there is a problem in the WEB project, which requires the background to refresh and monitor the data in the database in real time.
every time FLASK starts, it starts a thread to monitor the order placed by the customer and whether the order has been paid successfully.
after the customer changes the database state after the payment is successful, one more thread is opened to execute the script to ship the order.
how to implement it in Flask?