Explorar el Código

update run_time

wangkun hace 3 años
padre
commit
c9a4112577
Se han modificado 1 ficheros con 12 adiciones y 5 borrados
  1. 12 5
      main/run.py

+ 12 - 5
main/run.py

@@ -123,11 +123,18 @@ def main_prod():
     """
     正式环境主函数
     """
-    scheduler = BlockingScheduler(timezone="Asia/Shanghai")
-    # 抓取视频的定时任务,在每天10点的40分,运行一次 job 方法
-    scheduler.add_job(kuaishou_prod_job, 'cron', hour=8, minute=00, misfire_grace_time=60)
-    # 开始运行脚本
-    scheduler.start()
+    while True:
+        while True:
+            if 20 >= Common.now.hour >= 8:
+                kuaishou_prod_job()
+            else:
+                break
+
+    # scheduler = BlockingScheduler(timezone="Asia/Shanghai")
+    # # 抓取视频的定时任务,在每天10点的40分,运行一次 job 方法
+    # scheduler.add_job(kuaishou_prod_job, 'cron', hour=8, minute=00, misfire_grace_time=60)
+    # # 开始运行脚本
+    # scheduler.start()
 
 
 if __name__ == "__main__":