redis_client icon indicating copy to clipboard operation
redis_client copied to clipboard

reconnection always occur per each transactions when timeout is zero

Open mezon525 opened this issue 7 years ago • 0 comments

It seems that the CRedisConnection::ConnRequest() method considers the server timeout value in the configuration is always greater than zero. But actually the default TIMEOUT value is zero in recent redis versions, and TIMEOUT 0 means "the server never disconnects the clients". Isn't it necessary to avoid reconnecting in the above situation?

I think the desirable code is like below. if (!m_pContext || m_pRedisServ->m_nSerTimeout > 0 && tmNow - m_nUseTime >= m_pRedisServ->m_nSerTimeout)

mezon525 avatar Jul 12 '17 00:07 mezon525