From 558d2564c512e2b20a27f0f8201ff7cd36f4f53f Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 6 Jun 2022 16:35:46 -0400 Subject: [PATCH] Only pass `is_brokercheck: bool` to endpoints that declare it --- piker/brokers/cli.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/piker/brokers/cli.py b/piker/brokers/cli.py index 9b046ca3..ee160b1c 100644 --- a/piker/brokers/cli.py +++ b/piker/brokers/cli.py @@ -93,11 +93,20 @@ def brokercheck(config, broker): # '_spawn_kwargs', # {}, # ) + + # TODO: eventually avoid this hack for `ib` XD + import inspect + get_client = brokermod.get_client + if 'is_brokercheck' in inspect.signature(get_client).parameters: + kwargs = {'is_brokercheck': True} + else: + kwargs = {} + async with ( # TODO: in theory we can actually spawn a local `brokerd` # and then try to make some basic feed queries? # maybe_open_runtime(**extra_tractor_kwargs), - brokermod.get_client(is_brokercheck=True) as client, + brokermod.get_client(**kwargs) as client, ): print_ok('done! inside client context.')