diff --git a/.gitignore b/.gitignore index b6d42b41..f4d99cbd 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ dist build client .gitignore + +logs.txt \ No newline at end of file diff --git a/app/requests/artists.py b/app/requests/artists.py index f9c1a99b..8c78f517 100644 --- a/app/requests/artists.py +++ b/app/requests/artists.py @@ -6,7 +6,7 @@ import requests from app import settings from app.utils.hashing import create_hash -from requests import ConnectionError +from requests import ConnectionError, ReadTimeout import urllib.parse @@ -19,7 +19,7 @@ def fetch_similar_artists(name: str): try: response = requests.get(url, timeout=10) response.raise_for_status() - except ConnectionError: + except (ConnectionError, ReadTimeout): return [] data = response.json() diff --git a/manage.py b/manage.py index a789a3ac..0962bd83 100644 --- a/manage.py +++ b/manage.py @@ -2,6 +2,7 @@ This file is used to run the application. """ import logging +# import sys from app.api import create_api from app.arg_handler import HandleArgs @@ -13,6 +14,8 @@ from app.start_info_logger import log_startup_info from app.utils.filesystem import get_home_res_path from app.utils.threading import background +# sys.stderr = open("./logs.txt", "w") + werkzeug = logging.getLogger("werkzeug") werkzeug.setLevel(logging.ERROR)