From 0891036e8cd17f8acc680909f12e12258891e35b Mon Sep 17 00:00:00 2001 From: fortrue Date: Mon, 26 Mar 2018 14:59:20 +0800 Subject: [PATCH] 1.wait for response when connecting to redis 2.remove unused code 3.fix sentinel.conf typing --- conf/sentinel.conf | 6 +++--- src/ConnectConnectionPool.cpp | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/conf/sentinel.conf b/conf/sentinel.conf index f50c24b..207f9b2 100644 --- a/conf/sentinel.conf +++ b/conf/sentinel.conf @@ -40,9 +40,9 @@ # ServerRetryTimeout 1 # KeepAlive 120 # Sentinels { -# + 10.2.2.2 -# + 10.2.2.3 -# + 10.2.2.4 +# + 10.2.2.2:7500 +# + 10.2.2.3:7500 +# + 10.2.2.4:7500 # } # Group shard001 { # } diff --git a/src/ConnectConnectionPool.cpp b/src/ConnectConnectionPool.cpp index 1430a1f..e4ea3e1 100644 --- a/src/ConnectConnectionPool.cpp +++ b/src/ConnectConnectionPool.cpp @@ -53,11 +53,10 @@ ConnectConnection* ConnectConnectionPool::getShareConnection(int db) c->close(mHandler); return nullptr; } - if (mServ->fail() || c->isConnecting()) { + if (mServ->fail()) { return nullptr; } return c; - return mServ->fail() ? nullptr : c; } ConnectConnection* ConnectConnectionPool::getPrivateConnection(int db)