Skip to content

Commit 5911948

Browse files
authored
Reduce timeout for coverstore URL requests
When coverstore experiences high traffic/saturation, this causes downstream strain/saturation on OL. Since this data isn't 100% essential and it should generally be much faster than 1s for an internal network request, dropping from 3s.
1 parent a6f107b commit 5911948

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openlibrary/core/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def info(self, fetch_author: bool = True) -> dict[str, Any] | None:
6666
if url.startswith("//"):
6767
url = "http:" + url
6868
try:
69-
d = requests.get(url, timeout=3).json()
69+
d = requests.get(url, timeout=1).json()
7070
d['created'] = parse_datetime(d['created'])
7171
if fetch_author:
7272
if d['author'] == 'None':

0 commit comments

Comments
 (0)