def __clean_order(self, order_type, day_num, uid_range): test_order = OrderMixes(order_type) test_order.batch_add_orders(day_num, uid_range) if order_type == PayTypeEnum.DEPOSIT: OrderDeposit.clean_hot_table() OrderDetailDeposit.clean_hot_table() else: OrderWithdraw.clean_hot_table() OrderDetailWithdraw.clean_hot_table() test_order.check_clean_result(day_num, uid_range) test_order.test_one_day_order_clean(day_num, uid_range) test_order.check_clean_result(day_num, uid_range)
def clean_order_table(): # 每天凌晨4点清理数据 from app.main import flask_app print('job clean_order_table running') with flask_app.app_context(): rst = OrderDeposit.clean_hot_table() print(rst) rst = OrderWithdraw.clean_hot_table() print(rst) rst = OrderDetailDeposit.clean_hot_table() print(rst) rst = OrderDetailWithdraw.clean_hot_table() print(rst)