Skip to content

Commit

Permalink
Fixes related with packit service slowliness (#862)
Browse files Browse the repository at this point in the history
Fixes related with packit service slowliness

Should partially fix packit/packit-service#2512

Reviewed-by: Matej Focko
Reviewed-by: Laura Barcziová
  • Loading branch information
2 parents 0042934 + f2b5830 commit 3d0800f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions ogr/services/github/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(
github_app_private_key_path: Optional[str] = None,
tokman_instance_url: Optional[str] = None,
github_authentication: GithubAuthentication = None,
max_retries: Union[int, Retry] = 0,
max_retries: Union[int, Retry] = 1,
**kwargs,
):
"""
Expand All @@ -69,12 +69,11 @@ def __init__(
else:
self._max_retries = Retry(
total=int(max_retries),
read=0,
# Retry mechanism active for these HTTP methods:
allowed_methods=["DELETE", "GET", "PATCH", "POST", "PUT"],
# Only retry on following HTTP status codes
status_forcelist=[500, 503, 403, 401],
raise_on_status=False,
raise_on_status=True,
)

if not self._default_auth_method:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def test_get_instances_from_dict_multiple_auth(instances_in_dict, result_instanc
"token": "abcd",
},
},
0,
1,
),
(
{
Expand Down

0 comments on commit 3d0800f

Please sign in to comment.