Browse Source

区域屏蔽需求

zhangbo 1 year ago
parent
commit
cba214bddb
4 changed files with 23 additions and 0 deletions
  1. 0 0
      parameter_dir/__init__.py
  2. 23 0
      parameter_dir/parameter_update.py
  3. 0 0
      utils_dir/__init__.py
  4. 0 0
      utils_dir/my_utils.py

+ 0 - 0
parameter_dir/__init__.py


+ 23 - 0
parameter_dir/parameter_update.py

@@ -0,0 +1,23 @@
+import json
+from db_helper import RedisHelper
+from config import set_config
+config_ = set_config()
+
+RISK_SHIELD_FILTER_RULE_V1_JSON = "RISK_SHIELD_FILTER_RULE_V1_JSON"
+
+def param_update_risk_rule():
+    """
+    定时更新风险过滤的规则
+    key=RISK_SHIELD_FILTER_RULE_V1_JSON
+    value= "{\"VLOG\": [\"北京\"]}"
+    """
+    redis_helper = RedisHelper()
+    global RISK_SHIELD_FILTER_RULE_V1_JSON
+    level_weight_initial = redis_helper.get_data_from_redis(key_name=config_.FLOWPOOL_LEVEL_WEIGHT_KEY_NAME)
+    if level_weight_initial is not None:
+        RISK_SHIELD_FILTER_RULE_V1_JSON = json.loads(level_weight_initial)
+
+    global flow_pool_abtest_config
+    flow_pool_abtest_config = redis_helper.get_data_from_redis(key_name=config_.FLOWPOOL_ABTEST_KEY_NAME)
+    if flow_pool_abtest_config is not None:
+        flow_pool_abtest_config = json.loads(flow_pool_abtest_config)

+ 0 - 0
utils_dir/__init__.py


+ 0 - 0
utils_dir/my_utils.py