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
|
# 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
|
||||||
|
|
Loading…
Reference in New Issue