Merge pull request #3468 from hroff-1902/cleanup_async_markets
Cleanup async markets
This commit is contained in:
@@ -190,7 +190,7 @@ class Exchange:
|
||||
def markets(self) -> Dict:
|
||||
"""exchange ccxt markets"""
|
||||
if not self._api.markets:
|
||||
logger.warning("Markets were not loaded. Loading them now..")
|
||||
logger.info("Markets were not loaded. Loading them now..")
|
||||
self._load_markets()
|
||||
return self._api.markets
|
||||
|
||||
@@ -275,8 +275,8 @@ class Exchange:
|
||||
except ccxt.BaseError as e:
|
||||
logger.warning('Unable to initialize markets. Reason: %s', e)
|
||||
|
||||
def _reload_markets(self) -> None:
|
||||
"""Reload markets both sync and async, if refresh interval has passed"""
|
||||
def reload_markets(self) -> None:
|
||||
"""Reload markets both sync and async if refresh interval has passed """
|
||||
# Check whether markets have to be reloaded
|
||||
if (self._last_markets_refresh > 0) and (
|
||||
self._last_markets_refresh + self.markets_refresh_interval
|
||||
|
@@ -139,8 +139,8 @@ class FreqtradeBot:
|
||||
:return: True if one or more trades has been created or closed, False otherwise
|
||||
"""
|
||||
|
||||
# Check whether markets have to be reloaded
|
||||
self.exchange._reload_markets()
|
||||
# Check whether markets have to be reloaded and reload them when it's needed
|
||||
self.exchange.reload_markets()
|
||||
|
||||
# Query trades from persistence layer
|
||||
trades = Trade.get_open_trades()
|
||||
|
Reference in New Issue
Block a user