docs: document Tencent quote refresh
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
import re
|
||||
from decimal import Decimal, InvalidOperation
|
||||
from typing import Callable, Iterable
|
||||
from urllib.error import HTTPError, URLError
|
||||
from urllib.request import urlopen
|
||||
|
||||
from grid_trading.domain.models import Instrument, QuoteSnapshot
|
||||
@@ -61,7 +62,10 @@ class TencentQuoteProvider:
|
||||
return {}
|
||||
query = ",".join(symbols)
|
||||
url = f"{self.endpoint}{query}"
|
||||
raw = self._fetcher(url, self.timeout)
|
||||
try:
|
||||
raw = self._fetcher(url, self.timeout)
|
||||
except (OSError, HTTPError, URLError) as exc:
|
||||
raise QuoteFetchError(f"Tencent quote request failed: {exc}") from exc
|
||||
return {quote.code: quote for quote in parse_tencent_response(raw)}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user