瀏覽代碼

Merge pull request #1934 from xiang90/fix_test

discovery: fix watch index
Xiang Li 11 年之前
父節點
當前提交
c620238257
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      discovery/discovery.go

+ 2 - 1
discovery/discovery.go

@@ -276,7 +276,8 @@ func (d *discovery) waitNodes(nodes client.Nodes, size int, index uint64) (clien
 	if len(nodes) > size {
 		nodes = nodes[:size]
 	}
-	w := d.c.RecursiveWatch(d.cluster, index)
+	// watch from the next index
+	w := d.c.RecursiveWatch(d.cluster, index+1)
 	all := make(client.Nodes, len(nodes))
 	copy(all, nodes)
 	for _, n := range all {