diff --git a/valkey/asyncio/client.py b/valkey/asyncio/client.py index 2098d585..9730b985 100644 --- a/valkey/asyncio/client.py +++ b/valkey/asyncio/client.py @@ -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, diff --git a/valkey/asyncio/cluster.py b/valkey/asyncio/cluster.py index c496ae0c..e7f916bf 100644 --- a/valkey/asyncio/cluster.py +++ b/valkey/asyncio/cluster.py @@ -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 diff --git a/valkey/asyncio/connection.py b/valkey/asyncio/connection.py index c7a18ad9..4eb72451 100644 --- a/valkey/asyncio/connection.py +++ b/valkey/asyncio/connection.py @@ -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, diff --git a/valkey/connection.py b/valkey/connection.py index a85b3db2..53d9707f 100644 --- a/valkey/connection.py +++ b/valkey/connection.py @@ -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,