luojunhui 3 днів тому
батько
коміт
9e7f976058

+ 4 - 2
app/core/config/settings/mysql.py

@@ -114,6 +114,8 @@ class ContentDeconstructionSupplyConfig(DatabaseConfig):
     db: str = "content-deconstruction-supply"
 
     model_config = SettingsConfigDict(
-        env_prefix="CONTENT_DECONSREUCTION_DB_", env_file=".env", case_sensitive=False, extra="ignore"
+        env_prefix="CONTENT_DECONSREUCTION_DB_",
+        env_file=".env",
+        case_sensitive=False,
+        extra="ignore",
     )
-

+ 75 - 23
app/domains/analysis_task/account_position_info.py

@@ -11,6 +11,8 @@ from tqdm.asyncio import tqdm
 
 from datetime import datetime, timedelta
 
+from app.infra.external.apollo import AsyncApolloApi
+
 
 class AccountPositionInfoConst:
     # 阅读率统计周期(秒)
@@ -48,33 +50,65 @@ class AccountPositionInfoConst:
     # 不再使用的服务号
     NOT_USED_SERVER_ACCOUNT = {"gh_84e744b16b3a", "gh_5855bed97938", "gh_61a72b720de3"}
 
-    # 违禁账号 or 迁移账号
-    FORBIDDEN_GH_IDS = {
-        "gh_4c058673c07e",
-        "gh_de9f9ebc976b",
-        "gh_7b4a5f86d68c",
-        "gh_f902cea89e48",
+    # Apollo 挂掉时的封禁账号兜底列表
+    FORBIDDEN_GH_IDS_FALLBACK = {
+        "gh_bfe5b705324a",
+        "gh_183d80deffb8",
         "gh_789a40fe7935",
-        "gh_cd041ed721e6",
-        "gh_62d7f423f382",
+        "gh_3ed305b5817f",
         "gh_043223059726",
-        "gh_6cfd1132df94",
-        "gh_7f5075624a50",
-        "gh_d4dffc34ac39",
-        "gh_c69776baf2cd",
         "gh_9877c8541764",
-        "gh_ac43e43b253b",
+        "gh_341e08f852f5",
+        "gh_9eef14ad6c16",
         "gh_93e00e187787",
-        "gh_080bb43aa0dc",
+        "gh_e0eb490115f5",
+        "gh_1686250f15b6",
+        "gh_62d7f423f382",
+        "gh_4568b5a7e2fe",
+        "gh_98ec0ffe69b3",
+        "gh_68e7fdc09fe4",
+        "gh_b3b10dc6410e",
+        "gh_cd041ed721e6",
+        "gh_d4dffc34ac39",
+        "gh_bff0bcb0694a",
+        "gh_e24da99dc899",
+        "gh_a51201bcff28",
+        "gh_4c058673c07e",
+        "gh_5ae65db96cb7",
         "gh_b1c71a0e7a85",
-        "gh_d5f935d0d1f2",
-        "gh_6b7c2a257263",
-        "gh_bfe5b705324a",
-        "gh_7e5818b2dd83",
+        "gh_ac43eb24376d",
+        "gh_ff487cb5dab3",
         "gh_a2901d34f75b",
-        "gh_5ae65db96cb7",
+        "gh_b181786a6c8c",
+        "gh_7c66e0dbd2cf",
+        "gh_5ff48e9fb9ef",
+        "gh_be8c29139989",
+        "gh_c91b42649690",
         "gh_72bace6b3059",
+        "gh_f902cea89e48",
+        "gh_6b7c2a257263",
         "gh_dd4c857bbb36",
+        "gh_c69776baf2cd",
+        "gh_d5f935d0d1f2",
+        "gh_c5cdf60d9ab4",
+        "gh_6d9f36e3a7be",
+        "gh_7f5075624a50",
+        "gh_56ca3dae948c",
+        "gh_03d45c260115",
+        "gh_ac43e43b253b",
+        "gh_adca24a8f429",
+        "gh_6cfd1132df94",
+        "gh_77f36c109fb1",
+        "gh_080bb43aa0dc",
+        "gh_660afe87b6fd",
+        "gh_7b4a5f86d68c",
+        "gh_968bb63520bb",
+        "gh_0e36c1cd92ab",
+        "gh_de9f9ebc976b",
+        "gh_b15de7c99912",
+        "gh_9f8dc5b0c74e",
+        "gh_7e5818b2dd83",
+        "gh_0c89e11f8bf3",
     }
 
     # 投流账号
@@ -97,10 +131,25 @@ class AccountPositionInfoConst:
 class AccountPositionReadRateAvg(AccountPositionInfoConst):
     """计算账号每个位置评价阅读率"""
 
-    def __init__(self, pool, log_client, trace_id):
+    def __init__(self, pool, log_client, trace_id, apollo_config=None):
         self.pool = pool
         self.log_client = log_client
         self.trace_id = trace_id
+        self.apollo_client = (
+            AsyncApolloApi(apollo_config=apollo_config, app_id=None, env="prod")
+            if apollo_config
+            else None
+        )
+
+    async def _get_forbidden_gh_ids(self) -> set:
+        """从 Apollo 获取封禁账号列表,失败时兜底使用硬编码列表"""
+        if not self.apollo_client:
+            return self.FORBIDDEN_GH_IDS_FALLBACK
+        try:
+            ids = await self.apollo_client.get_config_value(key="forbidden_gh_ids")
+            return set(ids)
+        except Exception:
+            return self.FORBIDDEN_GH_IDS_FALLBACK
 
     # 生成统计周期
     def generate_stat_duration(self, end_date: str) -> str:
@@ -333,8 +382,9 @@ class AccountPositionReadRateAvg(AccountPositionInfoConst):
 
         fans_mapper = await self.get_fans_for_each_date(start_date=start_dt)
         accounts = await self.get_publishing_accounts()
+        forbidden_gh_ids = await self._get_forbidden_gh_ids()
         for account in tqdm(accounts, desc="计算单个账号阅读率均值"):
-            if account["gh_id"] in self.FORBIDDEN_GH_IDS:
+            if account["gh_id"] in forbidden_gh_ids:
                 continue
 
             published_articles = await self.get_single_account_published_articles(
@@ -517,8 +567,9 @@ class AccountPositionReadAvg(AccountPositionReadRateAvg):
         account_with_read_rate_avg = await self.get_accounts_read_avg(dt)
         accounts = await self.get_publishing_accounts()
 
+        forbidden_gh_ids = await self._get_forbidden_gh_ids()
         for account in tqdm(accounts, desc="计算单个账号的阅读均值"):
-            if account["gh_id"] in self.FORBIDDEN_GH_IDS:
+            if account["gh_id"] in forbidden_gh_ids:
                 continue
 
             try:
@@ -570,8 +621,9 @@ class AccountPositionOpenRateAvg(AccountPositionReadRateAvg):
         )
 
         account_list = await self.get_publishing_accounts()
+        forbidden_gh_ids = await self._get_forbidden_gh_ids()
         for account in tqdm(account_list, desc="计算单个账号的打开率均值"):
-            if account["gh_id"] in self.FORBIDDEN_GH_IDS:
+            if account["gh_id"] in forbidden_gh_ids:
                 continue
 
             try:

+ 0 - 1
app/domains/analysis_task/rate_limited_article_filter/_utils.py

@@ -132,4 +132,3 @@ class RateLimitedArticleUtils:
         return await feishu_robot.bot(
             title=title, detail=detail, mention=mention, env="prod"
         )
-

+ 6 - 4
app/domains/analysis_task/rate_limited_article_filter/entrance.py

@@ -46,11 +46,13 @@ class RateLimitedArticleFilter(RateLimitedArticleMapper):
             )
             if insert_rows:
                 await self.tool.feishu_alert(
-                    title="限流策略命中文章",
-                    detail=remark,
-                    mention=True
+                    title="限流策略命中文章", detail=remark, mention=True
                 )
-                gh_id = data["gh_ids"][0]    # 删文是标题粒度的,删文过程中所有账号的标题都会被删除, gh_id 只作为一个参数传递即可
+                gh_id = data[
+                    "gh_ids"
+                ][
+                    0
+                ]  # 删文是标题粒度的,删文过程中所有账号的标题都会被删除, gh_id 只作为一个参数传递即可
                 await delete_illegal_gzh_articles(
                     gh_id=gh_id, title=title, delete_flag=self.RATE_LIMITED
                 )

+ 80 - 40
app/domains/data_recycle_tasks/recycle_daily_publish_articles.py

@@ -5,9 +5,11 @@ import datetime
 import urllib.parse
 import traceback
 
+from pyapollos import apollo_client
 from tqdm.asyncio import tqdm
 
 from app.infra.external import feishu_robot
+from app.infra.external.apollo import AsyncApolloApi
 from app.infra.crawler.wechat import get_article_list_from_account
 from app.infra.crawler.wechat import get_article_detail
 from app.core.pipeline import insert_article_into_recycle_pool
@@ -20,44 +22,6 @@ class Const:
 
     NEW_ACCOUNT_CRAWL_PERIOD = 60 * 60 * 24 * 30
 
-    FORBIDDEN_GH_IDS = [
-        "gh_4c058673c07e",
-        "gh_de9f9ebc976b",
-        "gh_7b4a5f86d68c",
-        "gh_f902cea89e48",
-        "gh_789a40fe7935",
-        "gh_cd041ed721e6",
-        "gh_62d7f423f382",
-        "gh_043223059726",
-        "gh_6cfd1132df94",
-        "gh_7f5075624a50",
-        "gh_d4dffc34ac39",
-        "gh_c69776baf2cd",
-        "gh_9877c8541764",
-        "gh_ac43e43b253b",
-        "gh_93e00e187787",
-        "gh_080bb43aa0dc",
-        "gh_b1c71a0e7a85",
-        "gh_d5f935d0d1f2",
-        "gh_6b7c2a257263",
-        "gh_bfe5b705324a",
-        "gh_7e5818b2dd83",
-        "gh_a2901d34f75b",
-        "gh_5ae65db96cb7",
-        "gh_72bace6b3059",
-        "gh_dd4c857bbb36",
-        "gh_ff487cb5dab3",
-        "gh_ac43eb24376d",
-        "gh_b15de7c99912",
-        "gh_56ca3dae948c",
-        "gh_341e08f852f5",
-        "gh_0c89e11f8bf3",
-        "gh_9eef14ad6c16",
-        "gh_c5cdf60d9ab4",
-        "gh_bff0bcb0694a",
-        "gh_3ed305b5817f",
-    ]
-
     # NOT USED SERVER ACCOUNT
     NOT_USED_SERVER_ACCOUNT = {"gh_84e744b16b3a", "gh_5855bed97938", "gh_61a72b720de3"}
 
@@ -81,6 +45,66 @@ class Const:
     ACCOUNT_FORBIDDEN_CODE = 25013
     CRAWL_CRASH_CODE = 20000
 
+    FORBIDDEN_GH_IDS_FALLBACK = {
+        "gh_bfe5b705324a",
+        "gh_183d80deffb8",
+        "gh_789a40fe7935",
+        "gh_3ed305b5817f",
+        "gh_043223059726",
+        "gh_9877c8541764",
+        "gh_341e08f852f5",
+        "gh_9eef14ad6c16",
+        "gh_93e00e187787",
+        "gh_e0eb490115f5",
+        "gh_1686250f15b6",
+        "gh_62d7f423f382",
+        "gh_4568b5a7e2fe",
+        "gh_98ec0ffe69b3",
+        "gh_68e7fdc09fe4",
+        "gh_b3b10dc6410e",
+        "gh_cd041ed721e6",
+        "gh_d4dffc34ac39",
+        "gh_bff0bcb0694a",
+        "gh_e24da99dc899",
+        "gh_a51201bcff28",
+        "gh_4c058673c07e",
+        "gh_5ae65db96cb7",
+        "gh_b1c71a0e7a85",
+        "gh_ac43eb24376d",
+        "gh_ff487cb5dab3",
+        "gh_a2901d34f75b",
+        "gh_b181786a6c8c",
+        "gh_7c66e0dbd2cf",
+        "gh_5ff48e9fb9ef",
+        "gh_be8c29139989",
+        "gh_c91b42649690",
+        "gh_72bace6b3059",
+        "gh_f902cea89e48",
+        "gh_6b7c2a257263",
+        "gh_dd4c857bbb36",
+        "gh_c69776baf2cd",
+        "gh_d5f935d0d1f2",
+        "gh_c5cdf60d9ab4",
+        "gh_6d9f36e3a7be",
+        "gh_7f5075624a50",
+        "gh_56ca3dae948c",
+        "gh_03d45c260115",
+        "gh_ac43e43b253b",
+        "gh_adca24a8f429",
+        "gh_6cfd1132df94",
+        "gh_77f36c109fb1",
+        "gh_080bb43aa0dc",
+        "gh_660afe87b6fd",
+        "gh_7b4a5f86d68c",
+        "gh_968bb63520bb",
+        "gh_0e36c1cd92ab",
+        "gh_de9f9ebc976b",
+        "gh_b15de7c99912",
+        "gh_9f8dc5b0c74e",
+        "gh_7e5818b2dd83",
+        "gh_0c89e11f8bf3",
+    }
+
     STAT_PERIOD = 3 * 24 * 3600
 
     INIT_STATUS = 0
@@ -90,10 +114,15 @@ class Const:
 
 
 class RecycleDailyPublishArticlesTask(Const):
-    def __init__(self, pool, log_client, date_string):
+    def __init__(self, pool, log_client, date_string, apollo_config=None):
         self.pool = pool
         self.log_client = log_client
         self.date_string = date_string
+        self.apollo_client = (
+            AsyncApolloApi(apollo_config=apollo_config, app_id=None, env="prod")
+            if apollo_config
+            else None
+        )
 
     async def get_publish_accounts(self):
         """
@@ -194,12 +223,23 @@ class RecycleDailyPublishArticlesTask(Const):
                 case _:
                     return
 
+    async def _get_forbidden_gh_ids(self) -> set:
+        """从 Apollo 获取封禁账号列表,失败时兜底使用硬编码列表"""
+        if not self.apollo_client:
+            return self.FORBIDDEN_GH_IDS_FALLBACK
+        try:
+            ids = await self.apollo_client.get_config_value(key="forbidden_gh_ids")
+            return set(ids)
+        except Exception:
+            return self.FORBIDDEN_GH_IDS_FALLBACK
+
     async def get_task_list(self):
         """recycle all publish accounts articles"""
         binding_accounts = await self.get_publish_accounts()
         # 过滤封禁账号
+        forbidden_gh_ids = await self._get_forbidden_gh_ids()
         binding_accounts = [
-            i for i in binding_accounts if i["gh_id"] not in self.FORBIDDEN_GH_IDS
+            i for i in binding_accounts if i["gh_id"] not in forbidden_gh_ids
         ]
 
         # account_status = await self.get_account_status()

+ 1 - 1
app/domains/llm_tasks/__init__.py

@@ -9,5 +9,5 @@ __all__ = [
     "CandidateAccountQualityScoreRecognizer",
     "ArticlePoolCategoryGeneration",
     "ExtractTitleFeatures",
-    "DecodeVideoProduce"
+    "DecodeVideoProduce",
 ]

+ 1 - 1
app/domains/llm_tasks/decode_cards/_const.py

@@ -31,7 +31,7 @@ class DecodeCardConst:
         FAILED = "FAILED"
 
     class SourceType:
-        PARTNER_CARD_TOULIU = 3    # 公众号投流-即转卡片
+        PARTNER_CARD_TOULIU = 3  # 公众号投流-即转卡片
         PARTNER_CARD_COOPERATE = 4  # 公众号合作-即转卡片
 
     class TaskChannel:

+ 18 - 6
app/domains/llm_tasks/decode_cards/_mapper.py

@@ -68,8 +68,13 @@ class CardDecodeTaskMapper(DecodeCardConst):
                 VALUES (%s, %s, %s, %s, %s, %s, %s)
             """
             params = (
-                source_id, config_id, source,
-                self.TaskChannel.PARTNER_CARD, payload, remark, status,
+                source_id,
+                config_id,
+                source,
+                self.TaskChannel.PARTNER_CARD,
+                payload,
+                remark,
+                status,
             )
         else:
             query = f"""
@@ -78,8 +83,12 @@ class CardDecodeTaskMapper(DecodeCardConst):
                 VALUES (%s, %s, %s, %s, %s, %s)
             """
             params = (
-                source_id, config_id, source,
-                self.TaskChannel.PARTNER_CARD, payload, remark,
+                source_id,
+                config_id,
+                source,
+                self.TaskChannel.PARTNER_CARD,
+                payload,
+                remark,
             )
         return await self.pool.async_save(query=query, params=params)
 
@@ -142,8 +151,11 @@ class CardDecodeTaskMapper(DecodeCardConst):
         return await self.pool.async_save(
             query=query,
             params=(
-                new_status, remark, source_id,
-                self.TaskStatus.INIT, self.TaskStatus.PROCESSING,
+                new_status,
+                remark,
+                source_id,
+                self.TaskStatus.INIT,
+                self.TaskStatus.PROCESSING,
                 config_id,
             ),
         )

+ 1 - 1
app/domains/llm_tasks/decode_cards/_utils.py

@@ -86,7 +86,7 @@ class CardDecodeUtils(DecodeCardConst):
                 last_exc = e
                 if attempt < COVER_DOWNLOAD_MAX_RETRIES - 1:
                     delay = min(
-                        COVER_DOWNLOAD_BACKOFF_BASE * (2 ** attempt),
+                        COVER_DOWNLOAD_BACKOFF_BASE * (2**attempt),
                         COVER_DOWNLOAD_BACKOFF_MAX,
                     )
                     jitter = random.uniform(0, delay * 0.5)

+ 1 - 3
app/domains/llm_tasks/decode_cards/create_decode_tasks.py

@@ -136,9 +136,7 @@ class CreateCardsDecodeTask(DecodeCardConst):
             return
 
         posts = self.tool.prepare_posts(new_cards)
-        submit_results = await self.tool.submit_decode_batch(
-            posts, config_id=config_id
-        )
+        submit_results = await self.tool.submit_decode_batch(posts, config_id=config_id)
         posts_by_cid = {p["channelContentId"]: p for p in posts}
 
         for card in new_cards:

+ 1 - 3
app/domains/llm_tasks/decode_cards/fetch_decode_results.py

@@ -108,9 +108,7 @@ class FetchCardDecodeResults(DecodeCardConst):
                 for i in range(0, len(tasks), self.SUBMIT_BATCH)
             ]
             await run_tasks_with_asyncio_task_group(
-                task_list=[
-                    {"batch": b, "config_id": config_id} for b in batches
-                ],
+                task_list=[{"batch": b, "config_id": config_id} for b in batches],
                 handler=lambda item, cid=config_id: self._process_batch(
                     item["batch"], cid
                 ),

+ 18 - 6
app/domains/llm_tasks/decode_material/_mapper.py

@@ -57,8 +57,13 @@ class MaterialDecodeTaskMapper(DecodeMaterialConst):
                 VALUES (%s, %s, %s, %s, %s, %s, %s)
             """
             params = (
-                source_id, self.CONFIG_ID, self.SourceType.MATERIAL,
-                self.TaskChannel.MATERIAL, payload, remark, status,
+                source_id,
+                self.CONFIG_ID,
+                self.SourceType.MATERIAL,
+                self.TaskChannel.MATERIAL,
+                payload,
+                remark,
+                status,
             )
         else:
             query = f"""
@@ -67,8 +72,12 @@ class MaterialDecodeTaskMapper(DecodeMaterialConst):
                 VALUES (%s, %s, %s, %s, %s, %s)
             """
             params = (
-                source_id, self.CONFIG_ID, self.SourceType.MATERIAL,
-                self.TaskChannel.MATERIAL, payload, remark,
+                source_id,
+                self.CONFIG_ID,
+                self.SourceType.MATERIAL,
+                self.TaskChannel.MATERIAL,
+                payload,
+                remark,
             )
         return await self.pool.async_save(query=query, params=params)
 
@@ -128,8 +137,11 @@ class MaterialDecodeTaskMapper(DecodeMaterialConst):
         return await self.pool.async_save(
             query=query,
             params=(
-                new_status, remark, source_id,
-                self.TaskStatus.INIT, self.TaskStatus.PROCESSING,
+                new_status,
+                remark,
+                source_id,
+                self.TaskStatus.INIT,
+                self.TaskStatus.PROCESSING,
                 self.CONFIG_ID,
             ),
         )

+ 1 - 3
app/domains/llm_tasks/decode_video/__init__.py

@@ -1,6 +1,4 @@
 from .decode_video_produce import DecodeVideoProduce
 
 
-__all__ = [
-    "DecodeVideoProduce"
-]
+__all__ = ["DecodeVideoProduce"]

+ 3 - 1
app/domains/llm_tasks/decode_video/_mapper.py

@@ -77,5 +77,7 @@ class VideoDecodeMapper(VideoDecodeConst):
             SELECT vid FROM aigc_topic_decode_task_result WHERE vid = %s AND status = %s;
         """
         return await self.pool.async_fetch(
-            query=query, db_name="content_decode", params=(video_id, self.TaskStatus.SUCCESS)
+            query=query,
+            db_name="content_decode",
+            params=(video_id, self.TaskStatus.SUCCESS),
         )

+ 4 - 5
app/domains/monitor_tasks/auto_reply_cards_monitor/_utils.py

@@ -139,10 +139,7 @@ class AutoReplyCardsMonitorUtils:
     @staticmethod
     async def get_cover_url(aes_key, file_id):
         url = "https://wechat-protocol.aiddit.com/xed/getCdnUrl"
-        data = {
-            "file_id": file_id,
-            "aes_key": aes_key
-        }
+        data = {"file_id": file_id, "aes_key": aes_key}
         headers = {
             "Content-Type": "application/json",
         }
@@ -152,7 +149,9 @@ class AutoReplyCardsMonitorUtils:
                     url, headers=headers, data=json.dumps(data)
                 )
             if response and response.get("status") != 0:
-                print(f"[ERROR] get_cover_url API error: status={response.get('status')}, msg={response.get('msg')}")
+                print(
+                    f"[ERROR] get_cover_url API error: status={response.get('status')}, msg={response.get('msg')}"
+                )
                 return None
             return response
         except Exception as e:

+ 6 - 2
app/domains/monitor_tasks/gzh_article_monitor/entrance.py

@@ -49,7 +49,9 @@ class InnerArticleMonitorTask(GzhArticleMonitorConst):
                             article=(wx_sn.decode("utf-8"), title, error_detail)
                         )
                         await self.tool.feishu_alert(
-                            title="长文——模式违规报警", detail=article_detail, mention=True
+                            title="长文——模式违规报警",
+                            detail=article_detail,
+                            mention=True,
                         )
                         return
 
@@ -67,7 +69,9 @@ class InnerArticleMonitorTask(GzhArticleMonitorConst):
                     if insert_row:
                         # illegal_articles 里面没有违规文章、首次出现报警
                         await self.tool.feishu_alert(
-                            title="长文——文章违规告警", detail=article_detail, mention=True
+                            title="长文——文章违规告警",
+                            detail=article_detail,
+                            mention=True,
                         )
                         # 判断文章是否删过
                         title_md5 = self.tool.title_to_md5(title)

+ 1 - 1
app/domains/recommend/i2i_recommend/__init__.py

@@ -1,4 +1,4 @@
 from .entrance import I2IRecommendDataSyncTask
 
 
-__all__ = ["I2IRecommendDataSyncTask"]
+__all__ = ["I2IRecommendDataSyncTask"]

+ 3 - 1
app/infra/external/feishu.py

@@ -207,7 +207,9 @@ class FeishuBotApi(Feishu):
                 }
 
     # 表格形式
-    async def create_feishu_table(self, title, columns, rows, mention, mention_users=None):
+    async def create_feishu_table(
+        self, title, columns, rows, mention, mention_users=None
+    ):
         """
         创建飞书表格消息
 

+ 0 - 1
app/infra/shared/tools.py

@@ -175,7 +175,6 @@ def show_desc_to_sta(show_desc: str):
             "点赞": "show_like_count",
             "付费": "show_pay_count",
             "赞赏": "show_zs_count",
-
             # 英文
             "reads": "show_view_count",
             "views": "show_view_count",

+ 18 - 11
app/jobs/task_handler.py

@@ -233,10 +233,12 @@ class TaskHandler:
         """每日发文数据回收"""
         date_str = self.data.get("date_string") or datetime.now().strftime("%Y-%m-%d")
         recycle = RecycleDailyPublishArticlesTask(
-            self.db_client, self.log_client, date_str
+            self.db_client, self.log_client, date_str, self.config.apollo
         )
         await recycle.deal()
-        check = CheckDailyPublishArticlesTask(self.db_client, self.log_client, date_str)
+        check = CheckDailyPublishArticlesTask(
+            self.db_client, self.log_client, date_str, self.config.apollo
+        )
         await check.deal()
         return TaskStatus.SUCCESS
 
@@ -370,7 +372,10 @@ class TaskHandler:
     async def _update_account_read_rate_avg_handler(self) -> int:
         """更新账号阅读率均值"""
         task = AccountPositionReadRateAvg(
-            pool=self.db_client, log_client=self.log_client, trace_id=self.trace_id
+            pool=self.db_client,
+            log_client=self.log_client,
+            trace_id=self.trace_id,
+            apollo_config=self.config.apollo,
         )
         await task.deal(end_date=self.data.get("end_date"))
         return TaskStatus.SUCCESS
@@ -379,7 +384,10 @@ class TaskHandler:
     async def _update_account_read_avg_handler(self) -> int:
         """更新账号阅读均值"""
         task = AccountPositionReadAvg(
-            pool=self.db_client, log_client=self.log_client, trace_id=self.trace_id
+            pool=self.db_client,
+            log_client=self.log_client,
+            trace_id=self.trace_id,
+            apollo_config=self.config.apollo,
         )
         await task.deal(end_date=self.data.get("end_date"))
         return TaskStatus.SUCCESS
@@ -388,7 +396,10 @@ class TaskHandler:
     async def _update_account_open_rate_avg_handler(self) -> int:
         """更新账号打开率均值"""
         task = AccountPositionOpenRateAvg(
-            pool=self.db_client, log_client=self.log_client, trace_id=self.trace_id
+            pool=self.db_client,
+            log_client=self.log_client,
+            trace_id=self.trace_id,
+            apollo_config=self.config.apollo,
         )
         await task.deal(date_string=self.data.get("date_string"))
         return TaskStatus.SUCCESS
@@ -483,18 +494,14 @@ class TaskHandler:
     @register("create_cards_decode_task")
     async def _create_cards_decode_task(self) -> int:
         """创建卡片解构任务"""
-        task = CreateCardsDecodeTask(
-            pool=self.db_client, log_service=self.log_client
-        )
+        task = CreateCardsDecodeTask(pool=self.db_client, log_service=self.log_client)
         await task.deal()
         return TaskStatus.SUCCESS
 
     @register("fetch_cards_decode_result")
     async def _fetch_cards_decode_result(self) -> int:
         """获取卡片解构结果"""
-        task = FetchCardDecodeResults(
-            pool=self.db_client, log_service=self.log_client
-        )
+        task = FetchCardDecodeResults(pool=self.db_client, log_service=self.log_client)
         await task.deal()
         return TaskStatus.SUCCESS