mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-15 02:21:21 +01:00
parent
fa3d533354
commit
b767df14c9
@ -33,13 +33,7 @@ class DatabaseInterface(object):
|
|||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def get_session(self) -> Session:
|
def get_session(self) -> Session:
|
||||||
got_session = False
|
|
||||||
while not got_session:
|
|
||||||
try:
|
|
||||||
session = self._sessionmaker() # type: Session
|
session = self._sessionmaker() # type: Session
|
||||||
got_session = True
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
try:
|
try:
|
||||||
yield session
|
yield session
|
||||||
session.commit()
|
session.commit()
|
||||||
|
Loading…
Reference in New Issue
Block a user