Added timeout to social media fetch request

This commit is contained in:
Suksi
2021-08-15 22:48:31 +03:00
parent d05c268e67
commit f5f2e451c4
+1 -1
View File
@@ -20,7 +20,7 @@ def call(url, payload):
Raises HTTPError if the HTTP response code is 4XX or 5XX. """
# append access token to payload
payload |= {"access_token": secrets["access_token"]}
response = requests.get("https://graph.instagram.com" + url, params=payload)
response = requests.get("https://graph.instagram.com" + url, params=payload, timeout=1)
response.raise_for_status()
return response.json()