瀏覽代碼

新增抓公众号粉丝

luojunhui 2 月之前
父節點
當前提交
8e8e09fc9f

+ 2 - 0
applications/tasks/monitor_tasks/__init__.py

@@ -6,6 +6,7 @@ from .gzh_article_monitor import OutsideGzhArticlesCollector
 from .gzh_article_monitor import InnerGzhArticlesMonitor
 from .limited_account_analysis import LimitedAccountAnalysisTask
 from .task_processing_monitor import TaskProcessingMonitor
+from .auto_reply_cards_monitor import AutoReplyCardsMonitor
 
 __all__ = [
     "check_kimi_balance",
@@ -16,4 +17,5 @@ __all__ = [
     "InnerGzhArticlesMonitor",
     "TaskProcessingMonitor",
     "LimitedAccountAnalysisTask",
+    "AutoReplyCardsMonitor",
 ]

+ 9 - 1
applications/tasks/task_handler.py

@@ -29,7 +29,7 @@ from applications.tasks.llm_tasks import ArticlePoolCategoryGeneration
 from applications.tasks.llm_tasks import CandidateAccountQualityScoreRecognizer
 from applications.tasks.llm_tasks import ExtractTitleFeatures
 
-
+from applications.tasks.monitor_tasks import AutoReplyCardsMonitor
 from applications.tasks.monitor_tasks import check_kimi_balance
 from applications.tasks.monitor_tasks import GetOffVideos
 from applications.tasks.monitor_tasks import CheckVideoAuditStatus
@@ -275,5 +275,13 @@ class TaskHandler(TaskMapper):
         await task.deal(date_string=self.data.get("date_string"))
         return self.TASK_SUCCESS_STATUS
 
+    # 自动关注公众号账号
+    async def _auto_follow_account_handler(self) -> int:
+        task = AutoReplyCardsMonitor(
+            pool=self.db_client, log_client=self.log_client
+        )
+        await task.deal(task_name="follow_gzh_task")
+        return self.TASK_SUCCESS_STATUS
+
 
 __all__ = ["TaskHandler"]

+ 2 - 0
applications/tasks/task_scheduler.py

@@ -209,6 +209,8 @@ class TaskScheduler(TaskHandler):
             "update_account_read_avg": self._update_account_read_avg_handler,
             # 更新账号打开率均值
             "update_account_open_rate_avg": self._update_account_open_rate_avg_handler,
+            # 自动关注公众号账号
+            "auto_follow_account": self._auto_follow_account_handler,
         }
 
         if task_name not in handlers: