From dadc96306fa6a7f1f9f07cc4e5b58d98a20899cb Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 28 Nov 2022 19:49:01 +0100 Subject: [PATCH] Better define what interface is external --- freqtrade/exchange/exchange_ws.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/freqtrade/exchange/exchange_ws.py b/freqtrade/exchange/exchange_ws.py index 6401c10b9..6144de2a7 100644 --- a/freqtrade/exchange/exchange_ws.py +++ b/freqtrade/exchange/exchange_ws.py @@ -53,24 +53,24 @@ class ExchangeWS(): logger.info(f"Removing {p} from watchlist") self._klines_watching.discard(p) - async def schedule_while_true(self) -> None: + async def _schedule_while_true(self) -> None: for p in self._klines_watching: if p not in self._klines_scheduled: self._klines_scheduled.add(p) pair, timeframe, candle_type = p task = asyncio.create_task( - self.continuously_async_watch_ohlcv(pair, timeframe, candle_type)) + self._continuously_async_watch_ohlcv(pair, timeframe, candle_type)) self._background_tasks.add(task) - task.add_done_callback(self.continuous_stopped) + task.add_done_callback(self._continuous_stopped) - def continuous_stopped(self, task: asyncio.Task): + def _continuous_stopped(self, task: asyncio.Task): self._background_tasks.discard(task) result = task.result() logger.info(f"Task finished {result}") # self._pairs_scheduled.discard(pair, timeframe, candle_type) - async def continuously_async_watch_ohlcv( + async def _continuously_async_watch_ohlcv( self, pair: str, timeframe: str, candle_type: CandleType) -> None: try: while (pair, timeframe, candle_type) in self._klines_watching: @@ -92,7 +92,7 @@ class ExchangeWS(): self._klines_watching.add((pair, timeframe, candle_type)) self.klines_last_request[(pair, timeframe, candle_type)] = time.time() # asyncio.run_coroutine_threadsafe(self.schedule_schedule(), loop=self._loop) - asyncio.run_coroutine_threadsafe(self.schedule_while_true(), loop=self._loop) + asyncio.run_coroutine_threadsafe(self._schedule_while_true(), loop=self._loop) self.cleanup_expired() async def get_ohlcv(