Forráskód Böngészése

fwh数据回收bug修复

luojunhui 10 órája
szülő
commit
37e33d3564
2 módosított fájl, 10 hozzáadás és 4 törlés
  1. 1 1
      fwh_data_manager.py
  2. 9 3
      tasks/data_tasks/fwh_data_recycle.py

+ 1 - 1
fwh_data_manager.py

@@ -12,7 +12,7 @@ if __name__ == '__main__':
     fwh_group_publish_monitor = FwhGroupPublishMonitor()
     fwh_group_publish_monitor.deal()
 
-    # 3. 保存数据到数据库
+    # # 3. 保存数据到数据库
     save_fwh_data_to_database = SaveFwhDataToDatabase()
     save_fwh_data_to_database.deal()
 

+ 9 - 3
tasks/data_tasks/fwh_data_recycle.py

@@ -429,7 +429,6 @@ class FwhGroupPublishMonitor(FwhDataRecycle):
         fetch_response = self.piaoquan_client.fetch(
             fetch_query, cursor_type=DictCursor, params=(gh_id, date_string)
         )
-        print(fetch_response[0])
         return fetch_response[0] if fetch_response else None
 
     def deal(self, date_string: str = datetime.today().strftime("%Y-%m-%d")):
@@ -437,8 +436,8 @@ class FwhGroupPublishMonitor(FwhDataRecycle):
         monitor the publish record
         """
         now = datetime.now()
-        if now.hour > 12:
-            return
+        # if now.hour > 12:
+        #     return
 
         gh_id_list = self.get_group_server_accounts()
 
@@ -487,6 +486,13 @@ class FwhGroupPublishMonitor(FwhDataRecycle):
             detail = self.get_remain_fans_and_publish_times(
                 gh_id, date_string
             )
+            if not detail:
+                self.feishu_robot.bot(
+                    title=f"{date_string}服务号发文详情",
+                    detail=f"{gh_id}--{account_name} 没有发布详情",
+                    env="server_account_publish_monitor",
+                )
+                continue
             remain_fans, remain_publish_times = detail['fans_before_publish'], detail['publish_times_before_publish']
             temp = {
                 "account_name": account_name,