Only pass `is_brokercheck: bool` to endpoints that declare it

ib_checker_hackz
Tyler Goodlet 2022-06-06 16:35:46 -04:00
parent 6feef5f1d9
commit 558d2564c5
1 changed files with 10 additions and 1 deletions

View File

@ -93,11 +93,20 @@ def brokercheck(config, broker):
# '_spawn_kwargs', # '_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 ( async with (
# TODO: in theory we can actually spawn a local `brokerd` # TODO: in theory we can actually spawn a local `brokerd`
# and then try to make some basic feed queries? # and then try to make some basic feed queries?
# maybe_open_runtime(**extra_tractor_kwargs), # 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.') print_ok('done! inside client context.')