Skip to content

Commit

Permalink
Merge pull request #9 from Edanflame/main
Browse files Browse the repository at this point in the history
[Mod] 增加数据查询失败容错
  • Loading branch information
vnpy committed Dec 26, 2021
2 parents 1dff8b2 + 857ca58 commit 27f9cab
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions vnpy_tushare/tushare_datafeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,17 @@ def query_bar_history(self, req: HistoryRequest) -> Optional[List[BarData]]:

adjustment = INTERVAL_ADJUSTMENT_MAP[interval]

d1 = ts.pro_bar(
ts_code=ts_symbol,
start_date=start,
end_date=end,
asset=asset,
freq=ts_interval
)
try:
d1 = ts.pro_bar(
ts_code=ts_symbol,
start_date=start,
end_date=end,
asset=asset,
freq=ts_interval
)
except IOError:
return []

df = deepcopy(d1)

while True:
Expand Down

0 comments on commit 27f9cab

Please sign in to comment.