Commit 69810de1 authored by Gerion Entrup's avatar Gerion Entrup
Browse files

core: better pooling behaviour

parent b9e887c1
......@@ -6,6 +6,7 @@ import os.path
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.pool import StaticPool
from collector import Collector
from translator import Translator
......@@ -15,8 +16,9 @@ from mbdata import patch_model_schemas, NO_SCHEMAS
class Main:
def init_database(self, dbfile):
engine = create_engine('sqlite:///' + dbfile)#, echo=True)
#engine = create_engine('sqlite://')#, echo=True)
engine = create_engine('sqlite:///' + dbfile,
connect_args={'check_same_thread':False},
poolclass=StaticPool)#, echo=True)
patch_model_schemas(NO_SCHEMAS)
Base.metadata.create_all(engine)
session_factory = sessionmaker(bind=engine)
......
Supports Markdown
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