Return empty search result on connection failure

If you spawn a brokerd set and no `ib` data feed was started (via our
`.data.feed.Feed` api) then there will be no active client loaded and
thus wont' be connected. So in these cases just return nothing, and
I guess we'll figure out real connection failures later?
history_view
Tyler Goodlet 2022-09-01 14:11:26 -04:00
parent 59884d251e
commit dd03ef42ac
1 changed files with 8 additions and 4 deletions

View File

@ -470,10 +470,14 @@ class Client:
# TODO add search though our adhoc-locally defined symbol set # TODO add search though our adhoc-locally defined symbol set
# for futes/cmdtys/ # for futes/cmdtys/
results = await self.search_stocks( try:
pattern, results = await self.search_stocks(
upto=upto, pattern,
) upto=upto,
)
except ConnectionError:
return {}
for key, deats in results.copy().items(): for key, deats in results.copy().items():
tract = deats.contract tract = deats.contract