浏览代码

ad_threshold_auto_update opt

liqian 1 年之前
父节点
当前提交
9311940c6c
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      ad_threshold_auto_update.py

+ 3 - 0
ad_threshold_auto_update.py

@@ -176,6 +176,9 @@ def update_threshold(threshold_record_old, threshold_record_new):
                     threshold_old = redis_helper.get_data_from_redis(key_name=key_name)
                     if threshold_old is None:
                         continue
+                    # 原阈值为0时,加10**(-5)兜底处理
+                    if float(threshold_old) == 0:
+                        threshold_old = float(threshold_old) + 10**(-5)
                     # 计算新的阈值
                     if group_key == 'mean_group':
                         if threshold_param_old['mean_group'] == 0: