Parcourir la source

fix(spider): 修复获取pid时异常捕获和等待逻辑

- 恢复对get_vod_list函数调用的异常捕获
- 重新启用调用后等待5秒的逻辑
- 修正注释中被禁用代码块的错误处理机制
- 提高代码的健壮性和稳定性
charley il y a 1 mois
Parent
commit
b5ca87ba91
1 fichiers modifiés avec 6 ajouts et 6 suppressions
  1. 6 6
      cxx_spider/super_vault_daily_spider.py

+ 6 - 6
cxx_spider/super_vault_daily_spider.py

@@ -383,12 +383,12 @@ def cxx_daily_main(log):
         token = sql_pool.select_one("SELECT token FROM super_vault_token")
 
         # 获取所有 pid
-        # try:
-        #     get_vod_list(log, sql_pool, token[0])
-        # except Exception as e:
-        #     log.error(f"Error fetching last_product_id: {e}")
-        #
-        # time.sleep(5)
+        try:
+            get_vod_list(log, sql_pool, token[0])
+        except Exception as e:
+            log.error(f"Error fetching last_product_id: {e}")
+
+        time.sleep(5)
 
         # 获取所有 report_state = 0 的 pid
         sql_detail_id_list = sql_pool.select_all("SELECT pid FROM super_vault_product_record WHERE report_state != 1")