Skip to content

Commit

Permalink
Revert "[db] Prefer NullPool for forked SQLAlchemy connections"
Browse files Browse the repository at this point in the history
This reverts commit f2b1118.
  • Loading branch information
Viyat Bhalodia committed May 30, 2017
1 parent 9b28d2b commit 5e39b8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions framework/db/db.py
Expand Up @@ -9,7 +9,7 @@

from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy import create_engine, exc
from sqlalchemy.pool import NullPool
from sqlalchemy.pool import QueuePool
from sqlalchemy.orm import Session as BaseSession

from framework.utils import FileOperations
Expand Down Expand Up @@ -128,7 +128,9 @@ def CreateEngine(self, BaseClass):
self._db_settings['DATABASE_IP'],
self._db_settings['DATABASE_PORT'],
self._db_settings['DATABASE_NAME']),
poolclass=NullPool)
poolclass=QueuePool,
pool_size=5,
max_overflow=10)
BaseClass.metadata.create_all(engine)
# Fix for forking
register_after_fork(engine, engine.dispose)
Expand Down

0 comments on commit 5e39b8f

Please sign in to comment.