Make errors in activateBid non fatal.

2024-05-20_merge
tecnovert 3 years ago
parent 3ba551c9da
commit 3e5c3e1e6a
No known key found for this signature in database
GPG Key ID: 8ED6D8750C4E3F93
  1. 11
      basicswap/basicswap.py

@ -899,7 +899,18 @@ class BasicSwap(BaseApp):
session = scoped_session(self.session_factory) session = scoped_session(self.session_factory)
for bid in session.query(Bid): for bid in session.query(Bid):
if bid.in_progress == 1 or (bid.state and bid.state > BidStates.BID_RECEIVED and bid.state < BidStates.SWAP_COMPLETED): if bid.in_progress == 1 or (bid.state and bid.state > BidStates.BID_RECEIVED and bid.state < BidStates.SWAP_COMPLETED):
try:
self.activateBid(session, bid) self.activateBid(session, bid)
except Exception as ex:
self.log.error('Failed to activate bid! Error: %s', str(ex))
if self.debug:
self.log.error(traceback.format_exc())
try:
self.deactivateBid(session, bid)
except Exception as ex:
self.log.error('Further error deactivating: %s', str(ex))
if self.debug:
self.log.error(traceback.format_exc())
finally: finally:
session.close() session.close()
session.remove() session.remove()

Loading…
Cancel
Save