Browse Source

阅读均值率阈值从+-5% --> +-10%

luojunhui 6 months ago
parent
commit
d4fe18807d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      cal_account_read_rate_avg_daily.py

+ 2 - 1
cal_account_read_rate_avg_daily.py

@@ -222,6 +222,7 @@ def check_each_position(db_client, gh_id, index, dt, avg_rate) -> dict:
     :param dt:
     :return:
     """
+    RELATIVE_VALUE_THRESHOLD = 0.1
     dt = int(dt.replace("-", ""))
     select_sql = f"""
         SELECT account_name, read_rate_avg
@@ -234,7 +235,7 @@ def check_each_position(db_client, gh_id, index, dt, avg_rate) -> dict:
         account_name = result[0][0]
         previous_read_rate_avg = result[0][1]
         relative_value = (avg_rate - previous_read_rate_avg) / previous_read_rate_avg
-        if -0.05 <= relative_value <= 0.05:
+        if -RELATIVE_VALUE_THRESHOLD <= relative_value <= RELATIVE_VALUE_THRESHOLD:
             return {}
         else:
             response = {