Commit 4d26f442 authored by Jean Michel Rouly's avatar Jean Michel Rouly
Browse files

Fixed api timeout

parent 6172c9c6
......@@ -31,7 +31,13 @@ def ISBNMetadata(standardISBN):
url = "" +\
str(standardISBN) +\
metadata = requests.get(url)
# In case the API fails to return, simply return None.
metadata = requests.get(url, timeout=0.1)
except ConnectionError:
return None
# format into a dictionary
dejson = metadata.json()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment