From b786e948f63c9a3677bb00f395627e7f56e3d6e9 Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Thu, 2 Nov 2023 12:46:53 -0600 Subject: [PATCH] added timeout to URL request to prevent script from hanging --- .github/jobs/docker_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/jobs/docker_utils.py b/.github/jobs/docker_utils.py index a40d6b2e56..edf0b00167 100644 --- a/.github/jobs/docker_utils.py +++ b/.github/jobs/docker_utils.py @@ -39,7 +39,7 @@ def get_dockerhub_url(branch_name): def docker_get_volumes_last_updated(current_branch): import requests dockerhub_url = get_dockerhub_url(current_branch) - dockerhub_request = requests.get(dockerhub_url) + dockerhub_request = requests.get(dockerhub_url, timeout=60) if dockerhub_request.status_code != 200: print(f"Could not find DockerHub URL: {dockerhub_url}") return None @@ -61,7 +61,7 @@ def docker_get_volumes_last_updated(current_branch): volumes_last_updated[repo_name] = repo['last_updated'] if not page['next']: break - page = requests.get(page['next']).json() + page = requests.get(page['next'], timeout=60).json() attempts += 1 return volumes_last_updated