瀏覽代碼

disable pooling :
engine = create_engine('...', poolclass=NullPool)

liyuyi@c-top.com.cn 3 年之前
父節點
當前提交
6e276c6175
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      config/url_and_db.py

+ 1 - 1
config/url_and_db.py

@@ -13,7 +13,7 @@ def get_db_engine(db_info):
                   db_info['host'],
                   db_info['port'],
                   db_info['database'])
-    engine = create_engine(db_con_str, connect_args={'charset': 'utf8mb4'})
+    engine = create_engine(db_con_str, connect_args={'charset': 'utf8mb4'}, poolclas=None)
     return engine