Skip to content

Commit 4fea71b

Browse files
committed
add to httpcore transport too
1 parent 7f6b1a3 commit 4fea71b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

sentry_sdk/transport.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ def _parse_rate_limits(header, now=None):
196196
class BaseHttpTransport(Transport):
197197
"""The base HTTP transport."""
198198

199+
TIMEOUT = 10 # seconds
200+
199201
def __init__(self, options):
200202
# type: (Self, Dict[str, Any]) -> None
201203
from sentry_sdk.consts import VERSION
@@ -621,7 +623,7 @@ def _get_pool_options(self):
621623
options = {
622624
"num_pools": 2 if num_pools is None else int(num_pools),
623625
"cert_reqs": "CERT_REQUIRED",
624-
"timeout": urllib3.Timeout(connect=5, read=5),
626+
"timeout": urllib3.Timeout(connect=self.TIMEOUT, read=self.TIMEOUT),
625627
}
626628

627629
socket_options = None # type: Optional[List[Tuple[int, int, int | bytes]]]
@@ -766,6 +768,14 @@ def _request(
766768
self._auth.get_api_url(endpoint_type),
767769
content=body,
768770
headers=headers, # type: ignore
771+
extensions={
772+
"timeout": {
773+
"connect": self.TIMEOUT,
774+
"read": self.TIMEOUT,
775+
"write": self.TIMEOUT,
776+
"pool": self.TIMEOUT,
777+
}
778+
},
769779
)
770780
return response
771781

0 commit comments

Comments
 (0)