From 352adaf127c716f16f2a29bd412491ce30e166c4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 29 Oct 2022 19:45:46 +0200 Subject: [PATCH] Improve readability of is_time_to_refresh function --- freqtrade/exchange/exchange.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index bb03cc266..7a2b8ce7d 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -2004,11 +2004,8 @@ class Exchange: def _now_is_time_to_refresh(self, pair: str, timeframe: str, candle_type: CandleType) -> bool: # Timeframe in seconds interval_in_sec = timeframe_to_seconds(timeframe) - - return ( - (self._pairs_last_refresh_time.get((pair, timeframe, candle_type), 0) - + interval_in_sec) < arrow.utcnow().int_timestamp - ) + plr = self._pairs_last_refresh_time.get((pair, timeframe, candle_type), 0) + interval_in_sec + return plr < arrow.utcnow().int_timestamp @retrier_async async def _async_get_candle_history(