数据库连接池

parent e872b9f2
......@@ -32,8 +32,12 @@ tamp_product_engine = create_engine(
port=config[env]['MySQL']['port'],
user=config[env]['MySQL']['user'],
password=config[env]['MySQL']['password'],
charset="utf8"),
echo=True
charset="utf8"
),
max_overflow=0, # 超过连接池大小外最多创建的连接
pool_size=100, # 连接池大小
pool_timeout=5,
pool_recycle=600
)
tamp_order_engine = create_engine(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'.format(
......@@ -42,7 +46,12 @@ tamp_order_engine = create_engine(
port=config[env]['MySQL']['port'],
user=config[env]['MySQL']['user'],
password=config[env]['MySQL']['password'],
charset="utf8")
charset="utf8"
),
max_overflow=0, # 超过连接池大小外最多创建的连接
pool_size=100, # 连接池大小
pool_timeout=5,
pool_recycle=600
)
tamp_user_engine = create_engine(
......@@ -53,7 +62,11 @@ tamp_user_engine = create_engine(
user=config[env]['MySQL']['user'],
password=config[env]['MySQL']['password'],
charset="utf8"
)
),
max_overflow=0, # 超过连接池大小外最多创建的连接
pool_size=100, # 连接池大小
pool_timeout=5,
pool_recycle=600
)
tamp_fund_engine = create_engine(
......
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 to comment