Added timeout to GET request

This commit is contained in:
Aykhan 2023-03-10 20:41:23 +04:00
parent e1e6e12980
commit 82a92239e7
2 changed files with 6 additions and 4 deletions

View File

@ -9,9 +9,11 @@ services:
context: ../../
dockerfile: Docker/Dev/Dockerfile
command: >
bash -c "python3 src/manage.py makemigrations
&& python3 src/manage.py migrate
&& python src/manage.py runserver 0.0.0.0:8000"
bash -c "cd src
&& python3 manage.py makemigrations account
&& python3 manage.py makemigrations series
&& python3 manage.py migrate
&& python manage.py runserver 0.0.0.0:8000"
ports:
- "8000:8000"
volumes:

View File

@ -5,7 +5,7 @@ from .exceptions import *
def get_request(url: str) -> Union[StatusCodeError, APIError, MaximumUsageError, Dict]:
raw_data = get(url)
raw_data = get(url, timeout=7)
if raw_data.status_code != 200:
raise StatusCodeError(raw_data.status_code)