outgoing_http: Support fractional-second timeouts.

This commit is contained in:
Alex Vandiver 2024-03-05 02:40:17 +00:00 committed by Tim Abbott
parent 1cba83f9c5
commit c7e92ee2f3
1 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ class OutgoingSession(requests.Session):
def __init__( def __init__(
self, self,
role: str, role: str,
timeout: int, timeout: float,
headers: Optional[Dict[str, str]] = None, headers: Optional[Dict[str, str]] = None,
max_retries: Optional[Union[int, Retry]] = None, max_retries: Optional[Union[int, Retry]] = None,
) -> None: ) -> None:
@ -29,9 +29,9 @@ class OutgoingSession(requests.Session):
class OutgoingHTTPAdapter(requests.adapters.HTTPAdapter): class OutgoingHTTPAdapter(requests.adapters.HTTPAdapter):
role: str role: str
timeout: int timeout: float
def __init__(self, role: str, timeout: int, max_retries: Optional[Retry]) -> None: def __init__(self, role: str, timeout: float, max_retries: Optional[Retry]) -> None:
self.role = role self.role = role
self.timeout = timeout self.timeout = timeout
super().__init__(max_retries=max_retries) super().__init__(max_retries=max_retries)