Commit f6bcd601 authored by pengxiong's avatar pengxiong

去掉连接池

parent 8773d39e
......@@ -15,6 +15,7 @@ import sys
import yaml
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.pool import NullPool
env = sys.argv[-1]
work_dir = os.getcwd()
......@@ -31,10 +32,11 @@ tamp_user_engine = create_engine(
password=config[env]['MySQL']['password'],
charset="utf8"
),
max_overflow=0, # 超过连接池大小外最多创建的连接
pool_size=10, # 连接池大小
pool_timeout=5,
pool_recycle=60
poolclass=NullPool
# max_overflow=0, # 超过连接池大小外最多创建的连接
# pool_size=10, # 连接池大小
# pool_timeout=5,
# pool_recycle=60
)
tamp_pay_engine = create_engine(
......@@ -45,10 +47,11 @@ tamp_pay_engine = create_engine(
user=config[env]['MySQL']['user'],
password=config[env]['MySQL']['password'],
charset="utf8"),
max_overflow=0, # 超过连接池大小外最多创建的连接
pool_size=10, # 连接池大小
pool_timeout=5,
pool_recycle=60
poolclass=NullPool
# max_overflow=0, # 超过连接池大小外最多创建的连接
# pool_size=10, # 连接池大小
# pool_timeout=5,
# pool_recycle=60
)
tamp_zhibo_engine = create_engine(
......@@ -60,10 +63,11 @@ tamp_zhibo_engine = create_engine(
password=config[env]['MySQL']['password'],
charset="utf8"
),
max_overflow=0, # 超过连接池大小外最多创建的连接
pool_size=10, # 连接池大小
pool_timeout=5,
pool_recycle=60
poolclass=NullPool
# max_overflow=0, # 超过连接池大小外最多创建的连接
# pool_size=10, # 连接池大小
# pool_timeout=5,
# pool_recycle=60
)
redis = redis.Redis(
......@@ -105,4 +109,4 @@ class TAMP_SQL(object):
except:
self.session.rollback()
finally:
self.session.remove()
self.session.close()
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