Skip to content

Commit

Permalink
Fix attribute name for bw_api_manager
Browse files Browse the repository at this point in the history
It breaks coding style
  • Loading branch information
idkravitz authored and edeng23 committed Jun 8, 2021
1 parent 751c1c0 commit 1167918
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions binance_trade_bot/binance_stream_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def __init__(
):
self.cache = cache
self.logger = logger
self.bwApiManager = BinanceWebSocketApiManager(output_default="UnicornFy", enable_stream_signal_buffer=True)
self.bwApiManager.create_stream(["arr"], ["!miniTicker"], api_key=api_key, api_secret=api_secret)
self.bwApiManager.create_stream(["arr"], ["!userData"], api_key=api_key, api_secret=api_secret)
self.bw_api_manager = BinanceWebSocketApiManager(output_default="UnicornFy", enable_stream_signal_buffer=True)
self.bw_api_manager.create_stream(["arr"], ["!miniTicker"], api_key=api_key, api_secret=api_secret)
self.bw_api_manager.create_stream(["arr"], ["!userData"], api_key=api_key, api_secret=api_secret)
self.binance_client = binance_client
self.pending_orders: Set[Tuple[str, int]] = set()
self.pending_orders_mutex: threading.Lock = threading.Lock()
Expand Down Expand Up @@ -107,17 +107,17 @@ def _invalidate_balances(self):

def _stream_processor(self):
while True:
if self.bwApiManager.is_manager_stopping():
if self.bw_api_manager.is_manager_stopping():
sys.exit()

stream_signal = self.bwApiManager.pop_stream_signal_from_stream_signal_buffer()
stream_data = self.bwApiManager.pop_stream_data_from_stream_buffer()
stream_signal = self.bw_api_manager.pop_stream_signal_from_stream_signal_buffer()
stream_data = self.bw_api_manager.pop_stream_data_from_stream_buffer()

if stream_signal is not False:
signal_type = stream_signal["type"]
stream_id = stream_signal["stream_id"]
if signal_type == "CONNECT":
stream_info = self.bwApiManager.get_stream_info(stream_id)
stream_info = self.bw_api_manager.get_stream_info(stream_id)
if "!userData" in stream_info["markets"]:
self.logger.debug("Connect for userdata arrived", False)
self._fetch_pending_orders()
Expand Down Expand Up @@ -149,4 +149,4 @@ def _process_stream_data(self, stream_data):
self.logger.error(f"Unknown event type found: {event_type}\n{stream_data}")

def close(self):
self.bwApiManager.stop_manager_with_all_streams()
self.bw_api_manager.stop_manager_with_all_streams()

0 comments on commit 1167918

Please sign in to comment.