Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
fund_report
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭熊
fund_report
Commits
dc7dcac2
Commit
dc7dcac2
authored
Jan 20, 2021
by
pengxiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉数据库连接池
parent
3024b4a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
17 deletions
+7
-17
engine.py
app/api/engine.py
+7
-17
No files found.
app/api/engine.py
View file @
dc7dcac2
...
@@ -15,6 +15,7 @@ import sys
...
@@ -15,6 +15,7 @@ import sys
import
yaml
import
yaml
from
sqlalchemy
import
create_engine
from
sqlalchemy
import
create_engine
from
sqlalchemy.orm
import
sessionmaker
,
scoped_session
from
sqlalchemy.orm
import
sessionmaker
,
scoped_session
from
sqlalchemy.pool
import
NullPool
env
=
sys
.
argv
[
-
1
]
env
=
sys
.
argv
[
-
1
]
work_dir
=
os
.
getcwd
()
work_dir
=
os
.
getcwd
()
...
@@ -36,10 +37,7 @@ tamp_product_engine = create_engine(
...
@@ -36,10 +37,7 @@ tamp_product_engine = create_engine(
password
=
config
[
env
][
'MySQL'
][
'password'
],
password
=
config
[
env
][
'MySQL'
][
'password'
],
charset
=
"utf8"
charset
=
"utf8"
),
),
max_overflow
=
0
,
# 超过连接池大小外最多创建的连接
poolclass
=
NullPool
pool_size
=
100
,
# 连接池大小
pool_timeout
=
5
,
pool_recycle
=
600
)
)
tamp_order_engine
=
create_engine
(
tamp_order_engine
=
create_engine
(
'mysql+mysqldb://{user}:{password}@{host}:{port}/{db}?charset={charset}'
.
format
(
'mysql+mysqldb://{user}:{password}@{host}:{port}/{db}?charset={charset}'
.
format
(
...
@@ -50,10 +48,7 @@ tamp_order_engine = create_engine(
...
@@ -50,10 +48,7 @@ tamp_order_engine = create_engine(
password
=
config
[
env
][
'MySQL'
][
'password'
],
password
=
config
[
env
][
'MySQL'
][
'password'
],
charset
=
"utf8"
charset
=
"utf8"
),
),
max_overflow
=
0
,
# 超过连接池大小外最多创建的连接
poolclass
=
NullPool
pool_size
=
100
,
# 连接池大小
pool_timeout
=
5
,
pool_recycle
=
600
)
)
tamp_user_engine
=
create_engine
(
tamp_user_engine
=
create_engine
(
...
@@ -65,10 +60,7 @@ tamp_user_engine = create_engine(
...
@@ -65,10 +60,7 @@ tamp_user_engine = create_engine(
password
=
config
[
env
][
'MySQL'
][
'password'
],
password
=
config
[
env
][
'MySQL'
][
'password'
],
charset
=
"utf8"
charset
=
"utf8"
),
),
max_overflow
=
0
,
# 超过连接池大小外最多创建的连接
poolclass
=
NullPool
pool_size
=
100
,
# 连接池大小
pool_timeout
=
5
,
pool_recycle
=
600
)
)
tamp_fund_engine
=
create_engine
(
tamp_fund_engine
=
create_engine
(
...
@@ -80,10 +72,7 @@ tamp_fund_engine = create_engine(
...
@@ -80,10 +72,7 @@ tamp_fund_engine = create_engine(
password
=
config
[
env
][
'MySQL'
][
'password'
],
password
=
config
[
env
][
'MySQL'
][
'password'
],
charset
=
"utf8"
charset
=
"utf8"
),
),
max_overflow
=
0
,
# 超过连接池大小外最多创建的连接
poolclass
=
NullPool
pool_size
=
100
,
# 连接池大小
pool_timeout
=
5
,
pool_recycle
=
600
)
)
tamp_diagnose_app_engine
=
create_engine
(
tamp_diagnose_app_engine
=
create_engine
(
...
@@ -94,7 +83,8 @@ tamp_diagnose_app_engine = create_engine(
...
@@ -94,7 +83,8 @@ tamp_diagnose_app_engine = create_engine(
user
=
config
[
env
][
'MySQL'
][
'user'
],
user
=
config
[
env
][
'MySQL'
][
'user'
],
password
=
config
[
env
][
'MySQL'
][
'password'
],
password
=
config
[
env
][
'MySQL'
][
'password'
],
charset
=
"utf8"
charset
=
"utf8"
)
),
poolclass
=
NullPool
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment