Skip to content

Commit

Permalink
Cleanup txbuffer if worker got disabled
Browse files Browse the repository at this point in the history
Closes: #505
  • Loading branch information
bitphage committed Mar 18, 2020
1 parent a2a7e18 commit 86ed9d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dexbot/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def on_block(self, data):
self.workers[worker_name].error_ontick(e)
except Exception:
self.workers[worker_name].log.exception("in error_ontick()")
finally:
self.bitshares.txbuffer.clear()
self.config_lock.release()

def on_market(self, data):
Expand All @@ -154,6 +156,9 @@ def on_market(self, data):
self.workers[worker_name].error_onMarketUpdate(e)
except Exception:
self.workers[worker_name].log.exception("in error_onMarketUpdate()")
finally:
self.bitshares.txbuffer.clear()

self.config_lock.release()

def on_account(self, account_update):
Expand All @@ -175,6 +180,8 @@ def on_account(self, account_update):
self.workers[worker_name].error_onAccount(e)
except Exception:
self.workers[worker_name].log.exception("in error_onAccountUpdate()")
finally:
self.bitshares.txbuffer.clear()
self.config_lock.release()

def add_worker(self, worker_name, config):
Expand Down

0 comments on commit 86ed9d4

Please sign in to comment.