Skip to content

Commit

Permalink
Fix using separate timeout for remote rule (#235)
Browse files Browse the repository at this point in the history
JIRA: RHELWF-10541
  • Loading branch information
hluk authored Feb 20, 2024
1 parent 670802f commit 75c86a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion greenwave/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class Config(object):
'*': 'https://src.fedoraproject.org/{pkg_namespace}{pkg_name}/raw/{rev}/f/gating.yaml'
}
REMOTE_RULE_GIT_TIMEOUT = 30
REMOTE_RULE_GIT_MAX_RETRY = 3
KOJI_BASE_URL = 'https://koji.fedoraproject.org/kojihub'
# Options for outbound HTTP requests made by python-requests
REQUESTS_TIMEOUT = (6.1, 15)
Expand Down
3 changes: 2 additions & 1 deletion greenwave/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ def retrieve_scm_from_koji_build(nvr: str, source: str, koji_url: str):
@cached
def retrieve_yaml_remote_rule(url: str):
""" Retrieve a remote rule file content from the git web UI. """
response = requests_session.request('GET', url)
timeout = current_app.config['REMOTE_RULE_GIT_TIMEOUT']
response = requests_session.get(url, timeout=timeout)

if response.status_code == 404:
log.debug('Remote rule not found: %s', url)
Expand Down

0 comments on commit 75c86a4

Please sign in to comment.