Browse Source

add get_off_videos task

luojunhui 2 days ago
parent
commit
03cd759ce8

+ 6 - 4
applications/tasks/monitor_tasks/gzh_article_monitor.py

@@ -55,7 +55,7 @@ class OutsideGzhArticlesManager(MonitorConst):
             order by publish_timestamp desc
             limit %s;
         """
-        response = await self.pool.async_fetch(query=query, params=(gh_id, 1))
+        response, error = await self.pool.async_fetch(query=query, params=(gh_id, 1))
         if response:
             publish_timestamp = response[0]["publish_timestamp"]
             if publish_timestamp is None:
@@ -81,7 +81,8 @@ class OutsideGzhArticlesCollector(OutsideGzhArticlesManager):
             where
                 t1.mode_type = '代运营服务号';
         """
-        return await self.pool.async_fetch(query=query, db_name="aigc_db_pool")
+        response, error = await self.pool.async_fetch(query=query, db_name="aigc_db_pool")
+        return response
 
     async def fetch_each_account(self, account: dict):
         gh_id = account["gh_id"]
@@ -121,7 +122,7 @@ class OutsideGzhArticlesCollector(OutsideGzhArticlesManager):
             if response_code == self.ARTICLE_ILLEGAL_CODE:
                 illegal_reason = article_detail.get("msg")
                 # bot and return
-                feishu_robot.bot(
+                await feishu_robot.bot(
                     title="文章违规告警",
                     detail={
                         "账号名称": article["account_name"],
@@ -181,7 +182,8 @@ class OutsideGzhArticlesMonitor(OutsideGzhArticlesManager):
             from outside_gzh_account_monitor
             where illegal_status = {self.INIT_STATUS} and publish_timestamp > {publish_timestamp_threshold};
         """
-        return await self.pool.async_fetch(query=fetch_query)
+        response, error = await self.pool.async_fetch(query=fetch_query)
+        return response
 
     async def check_each_article(self, article: dict):
         """

+ 1 - 0
applications/tasks/task_scheduler.py

@@ -109,6 +109,7 @@ class TaskScheduler:
                         "data": response,
                     }
                 )
+                await self.release_task(task_name=task_name, date_string=date_string, final_status=response['code'])
                 return await task_schedule_response.success_response(
                     task_name=task_name, data=response
                 )