ソースを参照

MOD:fix guofeng platfrom

cxyu 3 年 前
コミット
0e0329d52c
2 ファイル変更10 行追加13 行削除
  1. 2 1
      app/api_data/platform_order/get_order.py
  2. 8 12
      app/crontab_task/ad_hourly.py

+ 2 - 1
app/api_data/platform_order/get_order.py

@@ -70,7 +70,8 @@ def wending(start=None, end=None, new=None):
 
 @DingTalkDecorators("国风")
 def guofeng(start=None, end=None, new=None):
-    start = start if start > '2021-07-08' else '2021-07-08'
+    if start:
+        start = start if start > '2021-07-09' else '2021-07-09'
     logging.info('国风订单数据拉取,开始')
     if start is None:
         start = end = du.getNow()

+ 8 - 12
app/crontab_task/ad_hourly.py

@@ -9,11 +9,13 @@ import threading
 
 du = DateUtils()
 
+
 def hourly_run():
     # 广告数据
-    get_cost.hourly()# 广告相关消耗数据
+    get_cost.hourly()  # 广告相关消耗数据
     dw_image_cost_day.hourly()
 
+
 if __name__ == '__main__':
     logging.basicConfig(
         handlers=[
@@ -29,24 +31,18 @@ if __name__ == '__main__':
     logging.info('广告素材任务,开始')
     st = time.time()
 
-    hourly_thread=threading.Thread(target=hourly_run)
-    hourly_thread.daemon=True
+    hourly_thread = threading.Thread(target=hourly_run)
+    hourly_thread.daemon = True
     hourly_thread.start()
 
     while 1:
-        if time.time()-st > 3000:
+        if time.time() - st > 3000:
             logging.info('线程运行超过50分钟,强制停止')
             break
         if not hourly_thread.is_alive():
             break
 
-    if int(time.time()-st)>1500:
-        DingTalkUtils().send(f"小时任务耗时{int(time.time()-st)}秒",phone="15168342316")
+    if int(time.time() - st) > 1500:
+        DingTalkUtils().send(f"小时任务耗时{int(time.time() - st)}秒", phone="15168342316")
 
     logging.info('广告素材任务,结束')
-
-
-
-
-
-