Przeglądaj źródła

发送etl增加三次重试

zhangliang 2 tygodni temu
rodzic
commit
1e413459f9

+ 2 - 2
application/functions/zqkd_db_redis.py

@@ -189,10 +189,10 @@ class RedisOperations:
             return False
 
     def save_video_id(self, videoID):
-        """将视频ID存储到Redis中,并为其设置7天的过期时间"""
+        """将视频ID存储到Redis中,并为其设置3天的过期时间"""
         try:
             key = f"crawler:zqkd:{videoID}"
-            expiration_time = int(timedelta(days=7).total_seconds())
+            expiration_time = int(timedelta(days=3).total_seconds())
             self.client.setex(key, expiration_time, "1")
         except Exception as e:
             tb = traceback.format_exc()

+ 1 - 1
spider/crawler_online/zhongqingkandian.py

@@ -239,7 +239,7 @@ class ZhongQingKanDianRecommend:
             account_id = video_obj["channel_account_id"]
             account_name = video_obj["channel_account_name"]
             account_avatar = video_obj["avatar"]
-            # 插入用户信息,使用异步方法并等待结果
+            # 插入用户信息
             self.db_ops.insert_user(account_id, account_name, account_avatar)
             self.aliyun_log.logging(code="1007", message=f"用户数据写入成功,用户ID:{account_id}")
             self.LocalLog.info(f"用户数据写入成功,用户ID: {account_id}")