VIOLET fix: connect the divergence driver's data feed (dark + observe paths)
The driver owned a freshly built HazelcastDataFeed that nothing ever
connected; every 1s poll hit features_map=None ('NoneType' .get) at
ERROR level and no scans reached the divergence monitor. Connect with
retry before sampling. Verified live: WS bookTicker up for 50 symbols,
divergence rows landing in real time.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -223,6 +223,19 @@ def _build_divergence(sink=None):
|
||||
|
||||
async def _divergence_driver(divergence, data_feed, poll_s: float) -> None:
|
||||
"""Shared scan-sampling loop for both DARK and observe modes."""
|
||||
# The driver owns this feed instance and is its only connector; an
|
||||
# unconnected HazelcastDataFeed has features_map=None and every poll
|
||||
# raises 'NoneType' has no attribute 'get' at ERROR level (1 Hz).
|
||||
while True:
|
||||
ok = False
|
||||
try:
|
||||
ok = await data_feed.connect()
|
||||
except Exception as exc: # noqa: BLE001 — sampling must never die
|
||||
LOGGER.warning("divergence data feed connect error: %s", exc)
|
||||
if ok:
|
||||
break
|
||||
LOGGER.warning("divergence data feed not connected; retrying in 5s")
|
||||
await asyncio.sleep(5.0)
|
||||
started = False
|
||||
symbol = os.environ.get("DOLPHIN_VIOLET_SNAPSHOT_SYMBOL", "BTCUSDT")
|
||||
mode = os.environ.get("DOLPHIN_VIOLET_VENUE_MID_MODE", "ws").lower()
|
||||
|
||||
Reference in New Issue
Block a user