message handling fix, data waiting fix
This commit is contained in:
parent
346e73dd75
commit
ddc45ce2eb
@ -168,7 +168,10 @@ class DataProvider:
|
||||
timeout_str = f"for {timeout} seconds" if timeout > 0 else "indefinitely"
|
||||
logger.debug(f"Waiting for external data on {pair} for {timeout_str}")
|
||||
|
||||
if timeout > 0:
|
||||
pair_event.wait(timeout=timeout)
|
||||
else:
|
||||
pair_event.wait()
|
||||
|
||||
def add_pairlisthandler(self, pairlists) -> None:
|
||||
"""
|
||||
|
@ -164,6 +164,9 @@ class ExternalMessageConsumer:
|
||||
await asyncio.sleep(self.sleep_time)
|
||||
|
||||
break
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
continue
|
||||
except (
|
||||
socket.gaierror,
|
||||
ConnectionRefusedError,
|
||||
@ -214,7 +217,9 @@ class ExternalMessageConsumer:
|
||||
if message_data is None:
|
||||
return
|
||||
|
||||
key, value = message_data.get('key'), message_data.get('data')
|
||||
key, value = message_data.get('key'), message_data.get('value')
|
||||
|
||||
if key and value:
|
||||
pair, timeframe, candle_type = key
|
||||
|
||||
# Convert the JSON to a pandas DataFrame
|
||||
|
Loading…
Reference in New Issue
Block a user