import json

from my_config import set_config
from log import Log
from db_helper import RedisHelper

config_, _ = set_config()
log_ = Log()

flowpool_level_weight = {
    '1': 100,
    '2': 100,
    '3': 100,
    '4': 100,
    '5': 100,
    '6': 100,
}
log_.info(f"flowpool_level_weight: {flowpool_level_weight}")
redis_helper = RedisHelper()
redis_helper.set_data_to_redis(
    key_name=config_.FLOWPOOL_LEVEL_WEIGHT_KEY_NAME, value=json.dumps(flowpool_level_weight), expire_time=365 * 24 *3600
)
redis_helper.persist_key(key_name=config_.FLOWPOOL_LEVEL_WEIGHT_KEY_NAME)
log_.info(f"flowpool_level_weight update finished!")
