Skip to content

Commit

Permalink
Set socket_timeout default value to 2 seconds
Browse files Browse the repository at this point in the history
Fixes #119

Signed-off-by: Saverio Proto <saverioproto@microsoft.com>
  • Loading branch information
zioproto committed Nov 7, 2024
1 parent 49a9618 commit 5e32b97
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion valkey/asyncio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def __init__(
port: int = 6379,
db: Union[str, int] = 0,
password: Optional[str] = None,
socket_timeout: Optional[float] = None,
socket_timeout: Optional[float] = 2,
socket_connect_timeout: Optional[float] = None,
socket_keepalive: Optional[bool] = None,
socket_keepalive_options: Optional[Mapping[int, Union[int, bytes]]] = None,
Expand Down
2 changes: 1 addition & 1 deletion valkey/asyncio/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def __init__(
socket_connect_timeout: Optional[float] = None,
socket_keepalive: bool = False,
socket_keepalive_options: Optional[Mapping[int, Union[int, bytes]]] = None,
socket_timeout: Optional[float] = None,
socket_timeout: Optional[float] = 2,
retry: Optional["Retry"] = None,
retry_on_error: Optional[List[Type[Exception]]] = None,
# SSL related kwargs
Expand Down
2 changes: 1 addition & 1 deletion valkey/asyncio/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __init__(
*,
db: Union[str, int] = 0,
password: Optional[str] = None,
socket_timeout: Optional[float] = None,
socket_timeout: Optional[float] = 2,
socket_connect_timeout: Optional[float] = None,
retry_on_timeout: bool = False,
retry_on_error: Union[list, _Sentinel] = SENTINEL,
Expand Down
2 changes: 1 addition & 1 deletion valkey/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def __init__(
self,
db: int = 0,
password: Optional[str] = None,
socket_timeout: Optional[float] = None,
socket_timeout: Optional[float] = 2,
socket_connect_timeout: Optional[float] = None,
retry_on_timeout: bool = False,
retry_on_error=SENTINEL,
Expand Down

0 comments on commit 5e32b97

Please sign in to comment.