Skip to content

Commit

Permalink
added timeout to URL request to prevent script from hanging
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe committed Nov 2, 2023
1 parent 1c9c405 commit b786e94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/jobs/docker_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b786e94

Please sign in to comment.