diff options
author | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2011-11-04 01:15:32 +0400 |
---|---|---|
committer | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2011-11-04 01:15:32 +0400 |
commit | ccc916df0b179c755dd43cfaada6ee7b9f40db63 (patch) | |
tree | 6dc149dcb9a31a5d97d3cd6c3e9fcd4446e24733 /library.c | |
parent | 78b81d8cbf986af04b8f917ab7f1b705d581e038 (diff) |
Throw exception when master is syncing to slave.
This addresses GitHub issue #67.
Diffstat (limited to 'library.c')
-rw-r--r-- | library.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -144,6 +144,10 @@ PHPAPI char *redis_sock_read(RedisSock *redis_sock, int *buf_len TSRMLS_DC) switch(inbuf[0]) { case '-': + /* stale data */ + if(memcmp(inbuf + 1, "-ERR SYNC ", 10) == 0) { + zend_throw_exception(redis_exception_ce, "SYNC with master in progress", 0 TSRMLS_CC); + } return NULL; case '$': |