|
@@ -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)
|