Handle logging against IPC stream vs. throttled channel on overruns
parent
47d0c81a2d
commit
8e390278f5
|
@ -253,11 +253,17 @@ async def sample_and_broadcast(
|
||||||
try:
|
try:
|
||||||
stream.send_nowait((sym, quote))
|
stream.send_nowait((sym, quote))
|
||||||
except trio.WouldBlock:
|
except trio.WouldBlock:
|
||||||
log.warning(
|
ctx = getattr(sream, '_ctx', None)
|
||||||
f'Feed overrun {bus.brokername} ->'
|
if ctx:
|
||||||
f'{stream._ctx.channel.uid} !!!'
|
log.warning(
|
||||||
)
|
f'Feed overrun {bus.brokername} ->'
|
||||||
|
f'{ctx.channel.uid} !!!'
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
log.warning(
|
||||||
|
f'Feed overrun {bus.brokername} -> '
|
||||||
|
f'feed @ {tick_throttle} Hz'
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
await stream.send({sym: quote})
|
await stream.send({sym: quote})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue