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

View File

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