Commit 92c6fe33 by 岳巧源

modify config

parent a88ec87f
Showing with 12 additions and 6 deletions
...@@ -11,11 +11,16 @@ from common import request_to_jd_vc ...@@ -11,11 +11,16 @@ from common import request_to_jd_vc
# TODO 通知基石平台告警 ??? 是不是按照原来的方式?? 用is_mapping 字段来进行标识??? # TODO 通知基石平台告警 ??? 是不是按照原来的方式?? 用is_mapping 字段来进行标识???
config_dev = { config_dev = {
"mysql": {
"host": "192.168.1.238", "host": "192.168.1.238",
"port": 3306, "port": 3306,
"user": "liexin_data_distribution", "user": "liexin_data_distribution",
"password": "liexin_data_distribution#zsyM", "password": "liexin_data_distribution#zsyM",
"database": "liexin_data_distribution" "database": "liexin_data_distribution"
},
"redis": {
}
} }
config_prod = { config_prod = {
...@@ -28,11 +33,11 @@ def update_jd_attr_by_class(conf: dict): ...@@ -28,11 +33,11 @@ def update_jd_attr_by_class(conf: dict):
基于lie_shop_attr中的class_id来更新属性 基于lie_shop_attr中的class_id来更新属性
缺少的属性直接添加,改变的属性则进行update 缺少的属性直接添加,改变的属性则进行update
""" """
host = conf["host"] host = conf["mysql"]["host"]
port = conf["port"] port = conf["mysql"]["port"]
user = conf["user"] user = conf["mysql"]["user"]
password = conf["password"] password = conf["mysql"]["password"]
database = conf["database"] database = conf["mysql"]["database"]
db = pymysql.connect(host=host, port=port, user=user, password=password, database=database) db = pymysql.connect(host=host, port=port, user=user, password=password, database=database)
select_sql = "select distinct class_id from lie_shop_attr" select_sql = "select distinct class_id from lie_shop_attr"
cursor = db.cursor() cursor = db.cursor()
...@@ -208,7 +213,7 @@ def update_ext_attr_by_class_ids(conf: dict): ...@@ -208,7 +213,7 @@ def update_ext_attr_by_class_ids(conf: dict):
def insert_ext_attr_to_redis(): def insert_ext_attr_to_redis(class_id, attr_id):
""" """
拓展属性存到 redis中 拓展属性存到 redis中
key : jd_ext_attr key : jd_ext_attr
...@@ -218,6 +223,7 @@ def insert_ext_attr_to_redis(): ...@@ -218,6 +223,7 @@ def insert_ext_attr_to_redis():
if __name__ == '__main__': if __name__ == '__main__':
option = {"dev", "prod"} option = {"dev", "prod"}
if len(sys.argv) >= 2 and sys.argv[1] in option: if len(sys.argv) >= 2 and sys.argv[1] in option:
......
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