Skip to content

Commit

Permalink
Merge pull request #514 from csomh/retries
Browse files Browse the repository at this point in the history
PagureService: Make retries parametrizable

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
  • Loading branch information
softwarefactory-project-zuul[bot] authored Dec 15, 2020
2 parents 6ba0abf + 1b2ccf7 commit 49f79c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ogr/services/pagure/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# SOFTWARE.

import logging
from typing import List, Optional
from typing import List, Optional, Union

import requests

Expand All @@ -47,6 +47,7 @@ def __init__(
instance_url: str = "https://src.fedoraproject.org",
read_only: bool = False,
insecure: bool = False,
max_retries: Union[int, requests.packages.urllib3.util.Retry] = 5,
**_,
) -> None:
super().__init__()
Expand All @@ -56,7 +57,7 @@ def __init__(

self.session = requests.session()

adapter = requests.adapters.HTTPAdapter(max_retries=5)
adapter = requests.adapters.HTTPAdapter(max_retries=max_retries)

self.insecure = insecure
if self.insecure:
Expand Down

0 comments on commit 49f79c3

Please sign in to comment.