Jelajahi Sumber

修改deepseek火山引擎--> 官方版本

luojunhui 2 hari lalu
induk
melakukan
8e200e7bab
1 mengubah file dengan 16 tambahan dan 10 penghapusan
  1. 16 10
      published_articles_monitor.py

+ 16 - 10
published_articles_monitor.py

@@ -98,16 +98,22 @@ if __name__ == "__main__":
     long_articles_db_client = DatabaseConnector(db_config=long_articles_config)
     long_articles_db_client.connect()
 
-    # Number of concurrent threads
-    MAX_WORKERS = 4
+    # # Number of concurrent threads
+    # MAX_WORKERS = 4
 
     article_list = get_article_list(run_date=None)
 
-    with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
-        list(
-            tqdm(
-                executor.map(monitor_article, article_list),
-                total=len(article_list),
-                desc="Monitor Article List",
-            )
-        )
+    for article in tqdm(article_list):
+        try:
+            monitor_article(article)
+        except Exception as e:
+            print(e)
+
+    # with ThreadPoolExecutor(max_workers=MAX_WORKERS) as executor:
+    #     list(
+    #         tqdm(
+    #             executor.map(monitor_article, article_list),
+    #             total=len(article_list),
+    #             desc="Monitor Article List",
+    #         )
+    #     )