summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
authorKonstantin Merenkov <kmerenkov@yandex-team.ru>2010-11-02 16:09:33 +0300
committerKonstantin Merenkov <kmerenkov@yandex-team.ru>2010-11-02 16:09:33 +0300
commitb3e28546e4ff484a816a50b4ffb4011edd192e80 (patch)
tree92f585c3e475f0aea47bf596b655ef44f09388a7 /redis/client.py
parent36c73d49a6255b1c3f86a257d6bbc97ba898c77d (diff)
downloadredis-py-b3e28546e4ff484a816a50b4ffb4011edd192e80.tar.gz
socket_timeout works when connection initialization times out.
Diffstat (limited to 'redis/client.py')
-rw-r--r--redis/client.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/redis/client.py b/redis/client.py
index 1274228..c4f3bc4 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -49,6 +49,7 @@ class Connection(object):
return
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ sock.settimeout(self.socket_timeout)
sock.connect((self.host, self.port))
except socket.error, e:
# args for socket.error can either be (errno, "message")
@@ -61,7 +62,6 @@ class Connection(object):
(e.args[0], self.host, self.port, e.args[1])
raise ConnectionError(error_message)
sock.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1)
- sock.settimeout(self.socket_timeout)
self._sock = sock
self._fp = sock.makefile('r')
redis_instance._setup_connection()