Skip to content

Commit 9a3b0d6

Browse files
authored
Merge pull request #30 from TheRealHaoLiu/fix-opaclient-retries-and-timeout
Fix BaseClient not respecting retries and timeout
2 parents 1cf1464 + 3485447 commit 9a3b0d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

opa_client/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def __init__(
2323
ssl: bool = False,
2424
cert: Optional[Union[str, tuple]] = None,
2525
headers: Optional[dict] = None,
26+
retries: int = 2,
2627
timeout: float = 1.5,
2728
):
2829
if not isinstance(port, int):
@@ -34,15 +35,14 @@ def __init__(
3435
self.ssl = ssl
3536
self.cert = cert
3637
self.timeout = timeout
38+
self.retries = retries
3739

3840
self.schema = "https://" if ssl else "http://"
3941
self.root_url = f"{self.schema}{self.host}:{self.port}/{self.version}"
4042

4143
self.headers = headers
4244

4345
self._session = None # Will be initialized in the subclass
44-
self.retries = 2
45-
self.timeout = 1.5
4646

4747
def _build_url(
4848
self, path: str, query_params: Dict[str, str] = None

0 commit comments

Comments
 (0)