Enable daemon debug through top level kwarg

basic_orders
Tyler Goodlet 2021-03-17 08:36:34 -04:00
parent aaca2b2f33
commit e1dc2b9225
3 changed files with 8 additions and 5 deletions

View File

@ -91,7 +91,7 @@ async def maybe_spawn_brokerd(
# XXX: you should pretty much never want debug mode
# for data daemons when running in production.
debug_mode: bool = False,
debug_mode: bool = True,
) -> tractor._portal.Portal:
"""If no ``brokerd.{brokername}`` daemon-actor can be found,
spawn one in a local subactor and return a portal to it.
@ -115,7 +115,7 @@ async def maybe_spawn_brokerd(
tractor_kwargs = getattr(brokermod, '_spawn_kwargs', {})
async with tractor.open_nursery(
debug_mode=False,
#debug_mode=debug_mode,
) as nursery:
try:
# spawn new daemon
@ -244,7 +244,7 @@ async def open_feed(
loglevel=loglevel,
# TODO: add a cli flag for this
debug_mode=False,
# debug_mode=False,
) as portal:

View File

@ -408,7 +408,7 @@ class ChartPlotWidget(pg.PlotWidget):
self.name = name
self._lc = linked_charts
# view-local placeholder for book graphics
# scene-local placeholder for book graphics
# sizing to avoid overlap with data contents
self._max_l1_line_len: float = 0
@ -448,7 +448,7 @@ class ChartPlotWidget(pg.PlotWidget):
# for when the splitter(s) are resized
self._vb.sigResized.connect(self._set_yrange)
def last_bar_in_view(self) -> bool:
def last_bar_in_view(self) -> int:
self._ohlc[-1]['index']
def update_contents_labels(

View File

@ -181,10 +181,13 @@ class OrderMode:
log.runtime(result)
def on_cancel(self, uuid: str) -> None:
msg = self.book._sent_orders.pop(uuid, None)
if msg is not None:
self.lines.remove_line(uuid=uuid)
self.chart._cursor.show_xhair()
else:
log.warning(
f'Received cancel for unsubmitted order {pformat(msg)}'