Browse Source

Merge branch '2024-11-25-newMethod-REMOVE-APOLLO' of Server/title_with_video into 2024-09-23newDbTasks

luojunhui 5 months ago
parent
commit
a673ff090a
3 changed files with 7 additions and 7 deletions
  1. 4 0
      applications/config/const.py
  2. 2 5
      tasks/history_task.py
  3. 1 2
      tasks/new_contentId_task.py

+ 4 - 0
applications/config/const.py

@@ -32,6 +32,10 @@ class HistoryContentIdTaskConst:
     NEED_PUBLISH = 1
     DO_NOT_NEED_PUBLISH = 2
 
+    # 文章晋级or退场
+    UP_LEVEL_STATUS = 1
+    TITLE_EXIT_STATUS = -1
+
 
 class NewContentIdTaskConst(HistoryContentIdTaskConst):
     """

+ 2 - 5
tasks/history_task.py

@@ -32,7 +32,6 @@ class historyContentIdTask(object):
         self.gh_id_dict = json.loads(self.config.get_config_value("testAccountLevel2"))
         self.history_coroutines = self.config.get_config_value("historyArticleCoroutines")
         self.account_negative_category = json.loads(self.config.get_config_value("account_negative_category"))
-        self.new_method_gh_id = json.loads(self.config.get_config_value("newMethodGhId"))
 
     async def get_tasks(self):
         """
@@ -251,8 +250,6 @@ class historyContentIdTask(object):
         校验文章是标题是否晋升 or 退场
         :return:
         """
-        UP_LEVEL_STATUS = 1
-        TITLE_EXIT_STATUS = -1
         sql = f"""
             SELECT lat.article_title, cstp.status
             FROM long_articles_text lat
@@ -262,7 +259,7 @@ class historyContentIdTask(object):
         result = await self.mysql_client.async_select(sql)
         if result:
             status = result[0][1]
-            if status in {UP_LEVEL_STATUS, TITLE_EXIT_STATUS}:
+            if status in {self.const.UP_LEVEL_STATUS, self.const.TITLE_EXIT_STATUS}:
                 return True
             else:
                 return False
@@ -377,7 +374,7 @@ class historyContentIdTask(object):
             if affected_rows == 0:
                 print("修改行数为 0,多个进程抢占同一个 task, 抢占失败,进程退出")
                 return
-            if gh_id in self.new_method_gh_id or publish_flag == self.const.DO_NOT_NEED_PUBLISH:
+            if publish_flag == self.const.DO_NOT_NEED_PUBLISH:
                 logging(
                     code="3013",
                     info="长文系统托管, 不进行发布",

+ 1 - 2
tasks/new_contentId_task.py

@@ -29,7 +29,6 @@ class NewContentIdTask(object):
         self.gh_id_dict = json.loads(self.config.get_config_value("testAccountLevel2"))
         self.account_map = json.loads(self.config.get_config_value("accountMap"))
         self.spider_coroutines = self.config.get_config_value("spiderCoroutines")
-        self.new_method_gh_id = json.loads(self.config.get_config_value("newMethodGhId"))
         self.const = NewContentIdTaskConst()
 
     async def get_tasks(self):
@@ -752,7 +751,7 @@ class NewContentIdTask(object):
                     todo 若新建计划,计划为设置托管,但接入账号又在配置账号中,仍会走托管逻辑,需考虑历史存量的处理
                     目前先对这两种情况都做托管操作
                     """
-                    if gh_id in self.new_method_gh_id or publish_flag == self.const.DO_NOT_NEED_PUBLISH:
+                    if publish_flag == self.const.DO_NOT_NEED_PUBLISH:
                         logging(
                             code="3013",
                             info="不需要发布,长文系统托管发布",