From d2528723a30b300e14ecb4e35c6de84569d08c42 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 22 Feb 2019 08:48:22 -0500 Subject: [PATCH] Add timeout to log fetching operations --- buildsrht/blueprints/jobs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildsrht/blueprints/jobs.py b/buildsrht/blueprints/jobs.py index 138c408..4425f12 100644 --- a/buildsrht/blueprints/jobs.py +++ b/buildsrht/blueprints/jobs.py @@ -259,9 +259,9 @@ def job_by_id(username, job_id): if cl > log_max: r = requests.get(log_url, headers={ "Range": f"bytes={cl-log_max}-{cl-1}", - }) + }, timeout=3) else: - r = requests.get(log_url) + r = requests.get(log_url, timeout=3) if r.status_code >= 200 and r.status_code <= 299: logs.append({ "name": name, -- 2.38.5