Przeglądaj źródła

定时任务修改

zhangyong 10 miesięcy temu
rodzic
commit
75c27f1d0d
1 zmienionych plików z 12 dodań i 16 usunięć
  1. 12 16
      video_job.py

+ 12 - 16
video_job.py

@@ -5,21 +5,17 @@ from common import Material
 from video_rewriting.video_prep import getVideo
 from video_rewriting.video_prep import getVideo
 
 
 
 
-#
-# def video_start():
-#     print("开始执行")
-#     data =  Material.video_list()  # 假设这是一个异步函数
-#     getVideo.video_task(data)  # 假设这是一个异步函数
-#     print("执行完成")
-#
-#
-#
-# schedule.every().day.at("01:00").do(video_start)
-#
-# while True:
-#     schedule.run_pending()
-#     time.sleep(1)
 
 
+def video_start():
+    print("开始执行")
+    data = Material.video_list()  # 假设这是一个异步函数
+    getVideo.video_task(data)  # 假设这是一个异步函数
+    print("执行完成")
 
 
-data = Material.video_list()  # 假设这是一个异步函数
-getVideo.video_task(data)  # 假设这是一个异步函数
+video_start()
+
+schedule.every().day.at("01:00").do(video_start)
+
+while True:
+    schedule.run_pending()
+    time.sleep(1)