mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-02 11:57:43 +08:00
modify redis_cluster.cpp for supporting slot cache
This commit is contained in:
parent
358a73d07e
commit
7678442e78
@ -314,7 +314,9 @@ redis_client* redis_command::peek_conn(redis_cluster* cluster, int slot)
|
||||
if (slot < 0)
|
||||
conns = (redis_pool*) cluster->peek();
|
||||
else if ((conns = cluster->peek_slot(slot)) == NULL)
|
||||
{
|
||||
conns = (redis_pool*) cluster->peek();
|
||||
}
|
||||
|
||||
if (conns == NULL)
|
||||
{
|
||||
@ -349,7 +351,7 @@ const redis_result* redis_command::run(redis_cluster* cluster, size_t nchild)
|
||||
}
|
||||
|
||||
redis_result_t type;
|
||||
bool last_moved;
|
||||
bool last_moved = false;
|
||||
int n = 0;
|
||||
|
||||
while (n++ < redirect_max_)
|
||||
@ -384,7 +386,6 @@ const redis_result* redis_command::run(redis_cluster* cluster, size_t nchild)
|
||||
}
|
||||
else
|
||||
{
|
||||
last_moved = false;
|
||||
// 将连接对象归还给连接池对象
|
||||
conn->get_pool()->put(conn, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user