Selaa lähdekoodia

抓取当月新增粉丝

luojunhui 1 kuukausi sitten
vanhempi
commit
9606da23d5
1 muutettua tiedostoa jossa 12 lisäystä ja 1 poistoa
  1. 12 1
      applications/tasks/crawler_tasks/crawler_gzh_fans.py

+ 12 - 1
applications/tasks/crawler_tasks/crawler_gzh_fans.py

@@ -267,7 +267,12 @@ class CrawlerGzhFans(CrawlerGzhFansBase):
                         next_cursor_timestamp = user_list[-1].get("user_create_time")
                         await self.insert_gzh_fans_batch(account_info, user_list)
                         if next_cursor_timestamp <= newest_timestamp:
-                            print("新粉丝更新完成")
+                            await feishu_robot.bot(
+                                title=f"{account_info['account_name']}本月新增粉丝抓取完毕",
+                                detail=account_info,
+                                env="cookie_monitor",
+                                mention=False,
+                            )
                             break
 
                         else:
@@ -305,6 +310,12 @@ class CrawlerGzhFans(CrawlerGzhFansBase):
                     "fail_reason": str(e),
                 }
                 await self.insert_fail_detail(account_info["gh_id"], fail_obj)
+                await feishu_robot.bot(
+                    title=f"{account_info['account_name']}本月新增粉丝抓取异常,请查看",
+                    detail=fail_obj,
+                    env="cookie_monitor",
+                    mention=False,
+                )
                 break
 
     # 抓取单个账号存量的粉丝