Fix more postgres session leaks in role

This commit is contained in:
nolash
2021-03-01 20:35:05 +01:00
parent bcf20cbfd3
commit 3ceafa90f4
19 changed files with 111 additions and 91 deletions

View File

@@ -472,7 +472,9 @@ def get_tx(tx_hash):
:rtype: dict
"""
session = SessionBase.create_session()
tx = session.query(Otx).filter(Otx.tx_hash==tx_hash).first()
q = session.query(Otx)
q = q.filter(Otx.tx_hash==tx_hash)
tx = q.first()
if tx == None:
session.close()
raise NotLocalTxError('queue does not contain tx hash {}'.format(tx_hash))