Revert "Wait until got session"

This reverts commit fa3d533354.
This commit is contained in:
Jeremy Zhang 2018-03-25 20:31:25 +00:00
parent fa3d533354
commit b767df14c9

View File

@ -33,13 +33,7 @@ class DatabaseInterface(object):
@contextmanager @contextmanager
def get_session(self) -> Session: def get_session(self) -> Session:
got_session = False session = self._sessionmaker() # type: Session
while not got_session:
try:
session = self._sessionmaker() # type: Session
got_session = True
except:
pass
try: try:
yield session yield session
session.commit() session.commit()