bugfix
This commit is contained in:
parent
12be28f5f7
commit
53c58f00fc
@ -93,8 +93,13 @@ class SqlorPool:
|
|||||||
yielded_sqlor = await self._new_sqlor()
|
yielded_sqlor = await self._new_sqlor()
|
||||||
yielded_sqlor.used = True
|
yielded_sqlor.used = True
|
||||||
yielded_sqlor.use_at = time.time()
|
yielded_sqlor.use_at = time.time()
|
||||||
|
try:
|
||||||
yield yielded_sqlor.sqlor
|
yield yielded_sqlor.sqlor
|
||||||
yielded_sqlor.used = False
|
yielded_sqlor.used = False
|
||||||
|
return
|
||||||
|
except Exception as e:
|
||||||
|
yielded_sqlor.used = False
|
||||||
|
raise e
|
||||||
|
|
||||||
|
|
||||||
@SingletonDecorator
|
@SingletonDecorator
|
||||||
@ -147,6 +152,7 @@ class DBPools:
|
|||||||
await sqlor.rollback()
|
await sqlor.rollback()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
await sqlor.exit()
|
||||||
|
|
||||||
def get_exception(self):
|
def get_exception(self):
|
||||||
return self.e_except
|
return self.e_except
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user