From c7e92ee2f30bf6c302a34aeb37495ed09a1dc7cc Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Tue, 5 Mar 2024 02:40:17 +0000 Subject: [PATCH] outgoing_http: Support fractional-second timeouts. --- zerver/lib/outgoing_http.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zerver/lib/outgoing_http.py b/zerver/lib/outgoing_http.py index cd5bff0e5f..3283e0ecb5 100644 --- a/zerver/lib/outgoing_http.py +++ b/zerver/lib/outgoing_http.py @@ -9,7 +9,7 @@ class OutgoingSession(requests.Session): def __init__( self, role: str, - timeout: int, + timeout: float, headers: Optional[Dict[str, str]] = None, max_retries: Optional[Union[int, Retry]] = None, ) -> None: @@ -29,9 +29,9 @@ class OutgoingSession(requests.Session): class OutgoingHTTPAdapter(requests.adapters.HTTPAdapter): 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.timeout = timeout super().__init__(max_retries=max_retries)