Commit c725bd76 by 岳巧源

add helper.py

parent 30aec8af
Showing with 37 additions and 2 deletions
......@@ -6,6 +6,36 @@ import pymysql
import redis
import json
config_dev = {
"mysql": {
"host": "192.168.1.238",
"port": 3306,
"user": "liexin_data_distribution",
"password": "liexin_data_distribution#zsyM",
"database": "liexin_data_distribution"
},
"redis": {
"host": "192.168.1.235",
"port": 6379,
"password": "icDb29mLy2s"
}
}
config_prod = {
"mysql": {
"host": "bigdata2.ichunt.db",
"port": 3306,
"user": "DsbuUx",
"password": "sfj09JjsfpQx0",
"database": "liexin_data_distribution"
},
"redis": {
"host": "172.18.137.38",
"port": 6379,
"password": "icDb29mLy2s"
}
}
def update_vc_ext_redis(conf: dict):
"""
更新redis中的拓展参数
......@@ -59,4 +89,9 @@ def update_vc_ext_redis(conf: dict):
continue
value = json.dumps(attr_ids, ensure_ascii=False)
redis_db.hset(name="jd_ext_attr", key=key, value=value)
print("jd_ext_attr", key, value)
\ No newline at end of file
print("jd_ext_attr", key, value)
if __name__ == '__main__':
config = config_prod
update_vc_ext_redis(config)
print("======================> redis中拓展参数更新完毕!")
\ 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