Skip to content

Commit 91cd477

Browse files
committed
feat: connect
1 parent f6253cd commit 91cd477

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

backend/apps/db/db.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ def get_uri_from_config(type: str, conf: DatasourceConf) -> str:
5252
return db_url
5353

5454

55-
def get_engine(ds: CoreDatasource, timeout: int = 30) -> Engine:
55+
def get_engine(ds: CoreDatasource, timeout: int = 0) -> Engine:
5656
conf = DatasourceConf(**json.loads(aes_decrypt(ds.configuration))) if ds.type != "excel" else get_engine_config()
5757
if conf.timeout is None:
5858
conf.timeout = timeout
59+
if timeout > 0:
60+
conf.timeout = timeout
5961
if ds.type == "pg" and (conf.dbSchema is not None and conf.dbSchema != ""):
6062
engine = create_engine(get_uri(ds),
6163
connect_args={"options": f"-c search_path={urllib.parse.quote(conf.dbSchema)}",

0 commit comments

Comments
 (0)