minor fixes, rework consumer request, update requirements.txt
This commit is contained in:
@@ -19,8 +19,8 @@ from freqtrade.configuration.timerange import TimeRange
|
||||
from freqtrade.constants import CANCEL_REASON, DATETIME_PRINT_FORMAT
|
||||
from freqtrade.data.history import load_data
|
||||
from freqtrade.data.metrics import calculate_max_drawdown
|
||||
from freqtrade.enums import (CandleType, ExitCheckTuple, ExitType, SignalDirection, State,
|
||||
TradingMode)
|
||||
from freqtrade.enums import (CandleType, ExitCheckTuple, ExitType, RPCMessageType, RPCRequestType,
|
||||
SignalDirection, State, TradingMode)
|
||||
from freqtrade.exceptions import ExchangeError, PricingError
|
||||
from freqtrade.exchange import timeframe_to_minutes, timeframe_to_msecs
|
||||
from freqtrade.loggers import bufferHandler
|
||||
@@ -1089,6 +1089,16 @@ class RPC:
|
||||
'last_process_loc': last_p.astimezone(tzlocal()).strftime(DATETIME_PRINT_FORMAT),
|
||||
'last_process_ts': int(last_p.timestamp()),
|
||||
}
|
||||
|
||||
# We are passed a Channel object, we can only do sync functions on that channel object
|
||||
def _process_consumer_request(self, request, channel):
|
||||
# Should we ensure that request is Dict[str, Any]?
|
||||
type, data = request.get('type'), request.get('data')
|
||||
|
||||
if type == RPCRequestType.SUBSCRIBE:
|
||||
if all([any(x.value == topic for x in RPCMessageType) for topic in data]):
|
||||
logger.debug(f"{channel} subscribed to topics: {data}")
|
||||
channel.set_subscriptions(data)
|
||||
#
|
||||
# # ------------------------------ EXTERNAL SIGNALS -----------------------
|
||||
#
|
||||
|
Reference in New Issue
Block a user