Ver código fonte

bot get_off_job

luojunhui 2 dias atrás
pai
commit
132d663ba7
1 arquivos alterados com 12 adições e 1 exclusões
  1. 12 1
      applications/tasks/monitor_tasks/get_off_videos.py

+ 12 - 1
applications/tasks/monitor_tasks/get_off_videos.py

@@ -76,11 +76,13 @@ class GetOffVideos(GetOffVideosConst):
         task_list = await self.get_task_list(
             earliest_timestamp_threshold, expire_timestamp_threshold
         )
+        success_count = 0
+        failed_count = 0
         for task in tqdm(task_list):
             video_id = task["video_id"]
             try:
                 await self.update_video_audit_status(video_id)
-
+                success_count += 1
             except Exception as e:
                 await self.log_client.log(
                     contents={
@@ -95,6 +97,15 @@ class GetOffVideos(GetOffVideosConst):
                         },
                     }
                 )
+                failed_count += 1
+        if success_count or failed_count:
+            await feishu_robot.bot(
+                title="自动下架任务完成",
+                detail={
+                    "成功下架视频数量": success_count,
+                    "失败数量": failed_count,
+                }
+            )
 
     async def check(self):
         earliest_timestamp = int(time.time()) - self.EARLIEST_TIME