1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Fix defer order.

This commit is contained in:
Vladimir Mihailenco
2017-01-28 10:53:10 +02:00
parent 9cd4965689
commit 308ebee457
4 changed files with 25 additions and 20 deletions

View File

@ -162,8 +162,8 @@ func (d *sentinelFailover) Pool() *pool.ConnPool {
}
func (d *sentinelFailover) MasterAddr() (string, error) {
defer d.mu.Unlock()
d.mu.Lock()
defer d.mu.Unlock()
// Try last working sentinel.
if d.sentinel != nil {