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

@ -328,8 +328,8 @@ func (c *Ring) heartbeat() {
// It is rare to Close a Ring, as the Ring is meant to be long-lived
// and shared between many goroutines.
func (c *Ring) Close() error {
defer c.mu.Unlock()
c.mu.Lock()
defer c.mu.Unlock()
if c.closed {
return nil