mna / redisc

A Go redis cluster client built on top of redigo.
BSD 3-Clause "New" or "Revised" License
227 stars 35 forks source link

Fix Do("") handling #29

Closed tysonmote closed 4 years ago

tysonmote commented 4 years ago

redigo/redis supports a special blank command in Do which flushes the connection's output buffer and receives all pending replies (if any). redigo/redis uses this when a connection is returned to its pool to ensure that the connection is ready for re-use no matter what state it is returned in.

This commit fixes the redisc connection's Do wrapper when called with the blank command:

mna commented 4 years ago

Thanks, LGTM!

mna commented 4 years ago

Oops, no one thing though, the rc field cannot be accessed without locking the connection's mutex, I'll make the change.