|
@@ -1497,7 +1497,8 @@ class CronComparedDataView(View):
|
|
|
order_list = PayPalService(PAYPAL_CRD['client_id'], PAYPAL_CRD['client_secret']).get_transactions(data)
|
|
|
thread = threading.Thread(target=CronComparedDataView.thread_compared_paypal_order,
|
|
|
args=(order_list['transaction_details'], end_date))
|
|
|
- thread.start()
|
|
|
+ thread.start() # 启动线程
|
|
|
+ thread.join() # 主线程等待子线程结束
|
|
|
return response.json(0)
|
|
|
except Exception as e:
|
|
|
LOGGER.info('CronComparedDataView.compared_paypal_order, errLine:{}, errMsg:{}'.format(
|
|
@@ -1573,7 +1574,6 @@ class CronComparedDataView(View):
|
|
|
order_ids=order_ids, creat_time=now_time, upd_time=now_time)
|
|
|
LOGGER.info('paypal每日对账结束时间:{}'.format(int(time.time())))
|
|
|
|
|
|
-
|
|
|
@staticmethod
|
|
|
def compared_wechat_order(response):
|
|
|
today = datetime.datetime.today()
|
|
@@ -1691,7 +1691,8 @@ class CronComparedDataView(View):
|
|
|
return response.json(0, list(order_qs))
|
|
|
thread = threading.Thread(target=CronComparedDataView.thread_compared_ansjer_order,
|
|
|
args=(list(order_qs), start_date))
|
|
|
- thread.start()
|
|
|
+ thread.start() # 启动线程
|
|
|
+ thread.join() # 主线程等待子线程结束
|
|
|
return response.json(0)
|
|
|
except Exception as e:
|
|
|
LOGGER.info('CronComparedDataView.compared_ansjer_order, errLine:{}, errMsg:{}'.format(
|