Skip to content

Commit 27df151

Browse files
committed
timeouts: only use connect_timeout and read_timeout
1 parent fe2ae8e commit 27df151

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

dvc_http/__init__.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,12 @@ def _prepare_credentials(self, **config):
8888
# The connector should not be owned by aiohttp.ClientSession since
8989
# it is closed by fsspec (HTTPFileSystem.close_session)
9090
client_kwargs["connector_owner"] = False
91+
9192
client_kwargs["connect_timeout"] = config.get(
9293
"connect_timeout", self.REQUEST_TIMEOUT
9394
)
94-
client_kwargs["sock_connect_timeout"] = config.get(
95-
"sock_connect_timeout", self.REQUEST_TIMEOUT
96-
)
97-
client_kwargs["sock_read_timeout"] = config.get(
98-
"sock_read_timeout", self.REQUEST_TIMEOUT
95+
client_kwargs["read_timeout"] = config.get(
96+
"read_timeout", self.REQUEST_TIMEOUT
9997
)
10098

10199
# Allow reading proxy configurations from the environment.
@@ -108,8 +106,7 @@ def _prepare_credentials(self, **config):
108106
async def get_client(
109107
self,
110108
connect_timeout: Optional[float],
111-
sock_connect_timeout: Optional[float],
112-
sock_read_timeout: Optional[float],
109+
read_timeout: Optional[float],
113110
**kwargs,
114111
):
115112
import aiohttp
@@ -132,8 +129,8 @@ async def get_client(
132129
kwargs["timeout"] = aiohttp.ClientTimeout(
133130
total=None,
134131
connect=connect_timeout,
135-
sock_connect=sock_connect_timeout,
136-
sock_read=sock_read_timeout,
132+
sock_connect=connect_timeout,
133+
sock_read=read_timeout,
137134
)
138135

139136
return ReadOnlyRetryClient(**kwargs)

0 commit comments

Comments
 (0)