Skip to content

Commit 346bff0

Browse files
committed
play around with timeouts
1 parent c863d29 commit 346bff0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sentry_sdk/transport.py

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

199-
TIMEOUT = 10 # seconds
199+
TIMEOUT = 30 # seconds
200200

201201
def __init__(self, options):
202202
# type: (Self, Dict[str, Any]) -> None
@@ -623,7 +623,7 @@ def _get_pool_options(self):
623623
options = {
624624
"num_pools": 2 if num_pools is None else int(num_pools),
625625
"cert_reqs": "CERT_REQUIRED",
626-
"timeout": urllib3.Timeout(connect=self.TIMEOUT, read=self.TIMEOUT),
626+
"timeout": urllib3.Timeout(total=self.TIMEOUT),
627627
}
628628

629629
socket_options = None # type: Optional[List[Tuple[int, int, int | bytes]]]
@@ -739,6 +739,8 @@ def __init__(self, options):
739739
class Http2Transport(BaseHttpTransport): # type: ignore
740740
"""The HTTP2 transport based on httpcore."""
741741

742+
TIMEOUT = 15
743+
742744
if TYPE_CHECKING:
743745
_pool: Union[
744746
httpcore.SOCKSProxy, httpcore.HTTPProxy, httpcore.ConnectionPool
@@ -770,10 +772,10 @@ def _request(
770772
headers=headers, # type: ignore
771773
extensions={
772774
"timeout": {
775+
"pool": self.TIMEOUT,
773776
"connect": self.TIMEOUT,
774-
"read": self.TIMEOUT,
775777
"write": self.TIMEOUT,
776-
"pool": self.TIMEOUT,
778+
"read": self.TIMEOUT,
777779
}
778780
},
779781
)

0 commit comments

Comments
 (0)