From 99b257013606687c75737489462e5933f53c9ee0 Mon Sep 17 00:00:00 2001 From: Abdul Qadeer Date: Thu, 25 Jan 2018 18:55:40 -0800 Subject: [PATCH] Update total load when removing a node --- consistent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consistent.go b/consistent.go index 3eaffb2..ea367c1 100644 --- a/consistent.go +++ b/consistent.go @@ -169,7 +169,7 @@ func (c *Consistent) Done(host string) { func (c *Consistent) Remove(host string) bool { c.Lock() defer c.Unlock() - + atomic.AddInt64(&c.totalLoad, -c.loadMap[host].Load) for i := 0; i < replicationFactor; i++ { h := c.hash(fmt.Sprintf("%s%d", host, i)) delete(c.hosts, h)