Skip to content

Commit f6253cd

Browse files
committed
feat: connect
1 parent 8141700 commit f6253cd

File tree

3 files changed

+9
-23
lines changed

3 files changed

+9
-23
lines changed

backend/apps/db/db.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,14 @@ def get_engine(ds: CoreDatasource, timeout: int = 30) -> Engine:
6060
engine = create_engine(get_uri(ds),
6161
connect_args={"options": f"-c search_path={urllib.parse.quote(conf.dbSchema)}",
6262
"connect_timeout": conf.timeout},
63-
pool_timeout=conf.timeout, pool_size=20, max_overflow=10)
63+
pool_timeout=conf.timeout)
6464
elif ds.type == 'sqlServer':
65-
engine = create_engine(get_uri(ds), pool_timeout=conf.timeout,
66-
pool_size=20,
67-
max_overflow=10)
65+
engine = create_engine(get_uri(ds), pool_timeout=conf.timeout)
6866
elif ds.type == 'oracle':
6967
engine = create_engine(get_uri(ds),
70-
pool_timeout=conf.timeout,
71-
pool_size=20,
72-
max_overflow=10)
68+
pool_timeout=conf.timeout)
7369
else:
74-
engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout}, pool_timeout=conf.timeout,
75-
pool_size=20,
76-
max_overflow=10)
70+
engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout}, pool_timeout=conf.timeout)
7771
return engine
7872

7973

backend/apps/db/engine.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ def get_engine_conn():
2525
db_url = get_engine_uri(conf)
2626
engine = create_engine(db_url,
2727
connect_args={"options": f"-c search_path={conf.dbSchema}", "connect_timeout": conf.timeout},
28-
pool_timeout=conf.timeout,
29-
pool_size=20,
30-
max_overflow=10)
28+
pool_timeout=conf.timeout)
3129
return engine
3230

3331

backend/apps/system/crud/assistant.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,18 +213,12 @@ def get_ds_engine(ds: AssistantOutDsSchema) -> Engine:
213213
engine = create_engine(uri,
214214
connect_args={"options": f"-c search_path={urllib.parse.quote(ds.db_schema)}",
215215
"connect_timeout": timeout},
216-
pool_timeout=timeout, pool_size=20, max_overflow=10)
216+
pool_timeout=timeout)
217217
elif ds.type == 'sqlServer':
218-
engine = create_engine(uri, pool_timeout=timeout,
219-
pool_size=20,
220-
max_overflow=10)
218+
engine = create_engine(uri, pool_timeout=timeout)
221219
elif ds.type == 'oracle':
222220
engine = create_engine(uri,
223-
pool_timeout=timeout,
224-
pool_size=20,
225-
max_overflow=10)
221+
pool_timeout=timeout)
226222
else:
227-
engine = create_engine(uri, connect_args={"connect_timeout": timeout}, pool_timeout=timeout,
228-
pool_size=20,
229-
max_overflow=10)
223+
engine = create_engine(uri, connect_args={"connect_timeout": timeout}, pool_timeout=timeout)
230224
return engine

0 commit comments

Comments
 (0)