Commit 5f433969 by 岳巧源

add vc

parent ebf724a6
Showing with 9 additions and 10 deletions
......@@ -277,15 +277,14 @@ def insert_ext_attr_to_redis(conf: dict):
print("jd_ext_attr", key, value)
def delete_redis_key(key: str, conf: dict):
redis_host = conf["redis"]["host"]
redis_port = conf["redis"]["port"]
redis_password = conf["redis"]["password"]
redis_db = redis.Redis(host=redis_host, port=redis_port, password=redis_password)
redis_db.delete(key)
# 此方法危险 不建议使用
# def delete_redis_key(key: str, conf: dict):
# redis_host = conf["redis"]["host"]
# redis_port = conf["redis"]["port"]
# redis_password = conf["redis"]["password"]
# redis_db = redis.Redis(host=redis_host, port=redis_port, password=redis_password)
# redis_db.delete(key)
if __name__ == '__main__':
conf = config_prod
delete_redis_key("jd_ext_attr", conf)
insert_ext_attr_to_redis(conf)
\ No newline at end of file
pass
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment