Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use connect_timeout as default value for sock_connect_timeout #29

Merged
merged 1 commit into from
Jan 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions dvc_http/__init__.py
Original file line number Diff line number Diff line change
@@ -88,14 +88,12 @@ def _prepare_credentials(self, **config):
# The connector should not be owned by aiohttp.ClientSession since
# it is closed by fsspec (HTTPFileSystem.close_session)
client_kwargs["connector_owner"] = False

client_kwargs["connect_timeout"] = config.get(
"connect_timeout", self.REQUEST_TIMEOUT
)
client_kwargs["sock_connect_timeout"] = config.get(
"sock_connect_timeout", self.REQUEST_TIMEOUT
)
client_kwargs["sock_read_timeout"] = config.get(
"sock_read_timeout", self.REQUEST_TIMEOUT
client_kwargs["read_timeout"] = config.get(
"read_timeout", self.REQUEST_TIMEOUT
)

# Allow reading proxy configurations from the environment.
@@ -108,8 +106,7 @@ def _prepare_credentials(self, **config):
async def get_client(
self,
connect_timeout: Optional[float],
sock_connect_timeout: Optional[float],
sock_read_timeout: Optional[float],
read_timeout: Optional[float],
**kwargs,
):
import aiohttp
@@ -132,8 +129,8 @@ async def get_client(
kwargs["timeout"] = aiohttp.ClientTimeout(
total=None,
connect=connect_timeout,
sock_connect=sock_connect_timeout,
sock_read=sock_read_timeout,
sock_connect=connect_timeout,
sock_read=read_timeout,
)

return ReadOnlyRetryClient(**kwargs)