add running false on shutdown, fix dp typing

This commit is contained in:
Timothy Pogue 2022-09-12 14:21:39 -06:00
parent 12a3e90f78
commit bf2e5dee75
2 changed files with 6 additions and 9 deletions

View File

@ -128,9 +128,9 @@ class DataProvider:
self,
pair: str,
dataframe: DataFrame,
last_analyzed: Optional[datetime] = None,
timeframe: Optional[str] = None,
candle_type: Optional[CandleType] = None,
last_analyzed: datetime,
timeframe: str,
candle_type: CandleType,
producer_name: str = "default"
) -> None:
"""
@ -140,10 +140,7 @@ class DataProvider:
:param timeframe: Timeframe to get data for
:param candle_type: Any of the enum CandleType (must match trading mode!)
"""
_timeframe = self._default_timeframe if not timeframe else timeframe
_candle_type = self._default_candle_type if not candle_type else candle_type
pair_key = (pair, _timeframe, _candle_type)
pair_key = (pair, timeframe, candle_type)
if producer_name not in self.__producer_pairs_df:
self.__producer_pairs_df[producer_name] = {}
@ -161,8 +158,7 @@ class DataProvider:
producer_name: str = "default"
) -> Tuple[DataFrame, datetime]:
"""
Get the pair data from the external sources. Will wait if the policy is
set to, and data is not available.
Get the pair data from the external sources.
:param pair: pair to get the data for
:param timeframe: Timeframe to get data for

View File

@ -109,6 +109,7 @@ class ExternalMessageConsumer:
"""
if self._thread and self._loop:
logger.info("Stopping ExternalMessageConsumer")
self._running = False
if self._sub_tasks:
# Cancel sub tasks