Skip to content

Commit 261aba5

Browse files
committed
Add timeout parameter to JokeAPI request for improved reliability
1 parent fb70e4d commit 261aba5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/api_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def handle_jokeapi(api, params=None):
5858
endpoint = f"https://v2.jokeapi.dev/joke/{category}"
5959

6060
# Make the API request with the updated endpoint and remaining params
61-
response = requests.get(endpoint, params=params, headers={"Accept": "application/json"})
61+
response = requests.get(endpoint, params=params, headers={"Accept": "application/json"}, timeout=10)
6262
return parse_jokeapi_response(response)
6363

6464
def parse_jokeapi_response(response):

0 commit comments

Comments
 (0)