diff --git a/api/deals/margin.py b/api/deals/margin.py index 81f74b200..00b806de2 100644 --- a/api/deals/margin.py +++ b/api/deals/margin.py @@ -318,7 +318,7 @@ def retry_repayment(self, query_loan, buy_back_fiat): symbol=self.active_bot.pair, amount=total_base_qty, ) - self.retry_repayment(query_loan, buy_back_fiat) + # self.retry_repayment(query_loan, buy_back_fiat) except Exception as error: print(error) self._append_errors( diff --git a/api/market_updates.py b/api/market_updates.py index 1a363d123..0548b06ce 100644 --- a/api/market_updates.py +++ b/api/market_updates.py @@ -53,7 +53,7 @@ ) scheduler.start() - atexit.register(lambda: scheduler.shutdown(wait=False)) + try: mu = StreamingController() @@ -66,8 +66,12 @@ mu.get_klines() else: logging.error(f"Websocket exception: {e}") + + atexit.register(lambda: scheduler.shutdown(wait=False)) except Exception as error: logging.error(f"Streaming controller error: {error}") mu = StreamingController() mu.get_klines() + + atexit.register(lambda: scheduler.shutdown(wait=False))