Skip to content

Commit 384dd31

Browse files
committed
Remove timeout; keep IGNORE_CLUSTER_ERRORS within this backend
1 parent 4cd11ac commit 384dd31

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

django_elasticache/cluster_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, cmd, response):
1717
'Unexpected response {} for command {}'.format(response, cmd))
1818

1919

20-
def get_cluster_info(host, port, ignore_cluster_errors=False, timeout=3):
20+
def get_cluster_info(host, port, ignore_cluster_errors=False):
2121
"""
2222
return dict with info about nodes in cluster and current version
2323
{
@@ -30,7 +30,7 @@ def get_cluster_info(host, port, ignore_cluster_errors=False, timeout=3):
3030
"""
3131
client = Telnet(host, int(port))
3232
client.write(b'version\n')
33-
res = client.read_until(b'\r\n', timeout).strip()
33+
res = client.read_until(b'\r\n').strip()
3434
version_list = res.split(b' ')
3535
if len(version_list) not in [2, 3] or version_list[0] != b'VERSION':
3636
raise WrongProtocolData('version', res)
@@ -43,7 +43,7 @@ def get_cluster_info(host, port, ignore_cluster_errors=False, timeout=3):
4343
regex_index, match_object, res = client.expect([
4444
re.compile(b'\n\r\nEND\r\n'),
4545
re.compile(b'ERROR\r\n')
46-
], timeout)
46+
])
4747
client.close()
4848

4949
if res == b'ERROR\r\n' and ignore_cluster_errors:

django_elasticache/memcached.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ def update_params(self, params):
5454
# set special 'behaviors' pylibmc attributes
5555
params['OPTIONS'] = {
5656
'tcp_nodelay': True,
57-
'ketama': True,
58-
'IGNORE_CLUSTER_ERRORS': False,
57+
'ketama': True
5958
}
6059

6160
def clear_cluster_nodes_cache(self):

tests/test_backend.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def test_patch_params():
2020
eq_(params['BINARY'], True)
2121
eq_(params['OPTIONS']['tcp_nodelay'], True)
2222
eq_(params['OPTIONS']['ketama'], True)
23-
eq_(params['OPTIONS']['IGNORE_CLUSTER_ERRORS'], False)
2423

2524

2625
@raises(Exception)

0 commit comments

Comments
 (0)