ck hace 3 años
padre
commit
8569a64e17
Se han modificado 2 ficheros con 25 adiciones y 8 borrados
  1. 24 0
      app/ad_hourly.py
  2. 1 8
      app/hourlyRun.py

+ 24 - 0
app/ad_hourly.py

@@ -0,0 +1,24 @@
+from model.DateUtils import DateUtils
+from app.api_data import get_cost
+from app.etl.dw import dw_image_cost_day
+du = DateUtils()
+import time
+from model.DingTalkUtils import DingTalkUtils
+
+
+if __name__ == '__main__':
+
+    st = time.time()
+
+    # 广告数据
+    get_cost.hourly()  # 广告相关消耗数据
+    dw_image_cost_day.hourly()
+
+    if int(time.time()-st)>1500:
+        DingTalkUtils.send(f"小时任务耗时{int(time.time()-st)}秒",phone="18860455786")
+
+
+
+
+
+

+ 1 - 8
app/hourlyRun.py

@@ -1,9 +1,5 @@
-
-from app.api_data import get_order
 from app.etl import data_stat_run
 from model.DateUtils import DateUtils
-from app.api_data import get_cost
-from app.etl.dw import dw_image_cost_day
 from app import task
 du = DateUtils()
 import time
@@ -13,16 +9,13 @@ from model.DingTalkUtils import DingTalkUtils
 if __name__ == '__main__':
 
     st = time.time()
+
     # 订单数据和消耗数据拉取
     task.hourly()
 
     # 数据处理
     data_stat_run.hourly()
 
-    # 广告数据
-    get_cost.hourly()  # 广告相关消耗数据
-    dw_image_cost_day.hourly()
-
     if int(time.time()-st)>1500:
         DingTalkUtils.send(f"小时任务耗时{int(time.time()-st)}秒",phone="18860455786")