Update hashring.go
This commit is contained in:
parent
5d542568fd
commit
013d76ce24
@ -82,6 +82,8 @@ func (h *HashRing) UpdateNode(nodeKey string, weight int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *HashRing) generate() {
|
func (h *HashRing) generate() {
|
||||||
|
h.mu.Lock()
|
||||||
|
defer h.mu.Unlock()
|
||||||
var totalW int
|
var totalW int
|
||||||
for _, w := range h.weights {
|
for _, w := range h.weights {
|
||||||
totalW += w
|
totalW += w
|
||||||
|
Loading…
Reference in New Issue
Block a user