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
parent
59884d251e
commit
dd03ef42ac
|
@ -470,10 +470,14 @@ class Client:
|
|||
|
||||
# TODO add search though our adhoc-locally defined symbol set
|
||||
# for futes/cmdtys/
|
||||
results = await self.search_stocks(
|
||||
pattern,
|
||||
upto=upto,
|
||||
)
|
||||
try:
|
||||
results = await self.search_stocks(
|
||||
pattern,
|
||||
upto=upto,
|
||||
)
|
||||
except ConnectionError:
|
||||
return {}
|
||||
|
||||
for key, deats in results.copy().items():
|
||||
|
||||
tract = deats.contract
|
||||
|
|
Loading…
Reference in New Issue