utils/community_get_discussion_details: Add a sane request timeout
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>merge-requests/854/head
parent
dd54caa4e4
commit
bda0580dbe
|
@ -131,7 +131,9 @@ def community_get_discussion_details(
|
|||
norad_cat_id)
|
||||
|
||||
try:
|
||||
response = requests.get('{}.json'.format(discussion_slug))
|
||||
response = requests.get(
|
||||
'{}.json'.format(discussion_slug), timeout=settings.COMMUNITY_TIMEOUT
|
||||
)
|
||||
response.raise_for_status()
|
||||
has_comments = (response.status_code == 200)
|
||||
except RequestException:
|
||||
|
|
|
@ -349,6 +349,10 @@ OBS_NO_RESULTS_IGNORE_TIME = config('OBS_NO_RESULTS_IGNORE_TIME', default=1800,
|
|||
# DB API
|
||||
DB_API_ENDPOINT = config('DB_API_ENDPOINT', default='https://db.satnogs.org/api/')
|
||||
|
||||
# Timeout in seconds for the community forum
|
||||
# (used e.g. when checking for the existance of certain threads)
|
||||
COMMUNITY_TIMEOUT = config('COMMUNITY_TIMEOUT', default=2.0, cast=float)
|
||||
|
||||
# ListView pagination
|
||||
ITEMS_PER_PAGE = config('ITEMS_PER_PAGE', default=25, cast=int)
|
||||
|
||||
|
|
Loading…
Reference in New Issue