Ver Fonte

Merge branch 'feature/luojunhui/20251202-update-account-read-rate-avg' of Server/LongArticleTaskServer into master

luojunhui há 3 meses atrás
pai
commit
b8b81784d6

+ 2 - 2
applications/tasks/analysis_task/account_position_info.py

@@ -353,13 +353,13 @@ class AccountPositionReadAvg(AccountPositionReadRateAvg):
         fetch_query = f"""
             select read_avg, update_time
             from account_avg_info_v3
-            where gh_id = %s and position = %s 
+            where gh_id = %s and position = %s
             order by update_time desc limit 30;
         """
         fetch_response_list = await self.pool.async_fetch(
             query=fetch_query, db_name="piaoquan_crawler", params=(gh_id, index)
         )
-        read_avg_list = [i["read_avg"] for i in fetch_response_list]
+        read_avg_list = [i["read_avg"] for i in fetch_response_list if i['read_avg'] is not None]
         n = len(read_avg_list)
         mean = np.mean(read_avg_list)
         std = np.std(read_avg_list, ddof=1)