Skip to content
Snippets Groups Projects
Commit 15d6c55d authored by ale's avatar ale
Browse files

the go-etcd 0.2.0-rc1 tag lags slightly behind the etcd release, sync to...

the go-etcd 0.2.0-rc1 tag lags slightly behind the etcd release, sync to commit 8a44ce0 for ModifiedIndex
parent ed289795
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ func TestCompareAndSwap(t *testing.T) { ...@@ -34,7 +34,7 @@ func TestCompareAndSwap(t *testing.T) {
} }
// This should succeed // This should succeed
resp, err = c.CompareAndSwap("foo", "bar2", 5, "", resp.Index) resp, err = c.CompareAndSwap("foo", "bar2", 5, "", resp.ModifiedIndex)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
...@@ -23,7 +23,7 @@ type Response struct { ...@@ -23,7 +23,7 @@ type Response struct {
TTL int64 `json:"ttl,omitempty"` TTL int64 `json:"ttl,omitempty"`
// The command index of the raft machine when the command is executed // The command index of the raft machine when the command is executed
Index uint64 `json:"index"` ModifiedIndex uint64 `json:"modifiedIndex"`
} }
// When user list a directory, we add all the node into key-value pair slice // When user list a directory, we add all the node into key-value pair slice
......
...@@ -41,7 +41,7 @@ func (c *Client) watch(prefix string, waitIndex uint64, recursive bool, receiver ...@@ -41,7 +41,7 @@ func (c *Client) watch(prefix string, waitIndex uint64, recursive bool, receiver
for { for {
resp, err := c.watchOnce(prefix, waitIndex, recursive, stop) resp, err := c.watchOnce(prefix, waitIndex, recursive, stop)
if resp != nil { if resp != nil {
waitIndex = resp.Index + 1 waitIndex = resp.ModifiedIndex + 1
receiver <- resp receiver <- resp
} else { } else {
return nil, err return nil, err
......
...@@ -24,7 +24,7 @@ func TestWatch(t *testing.T) { ...@@ -24,7 +24,7 @@ func TestWatch(t *testing.T) {
go setHelper("watch_foo", "bar", c) go setHelper("watch_foo", "bar", c)
resp, err = c.Watch("watch_foo", resp.Index, nil, nil) resp, err = c.Watch("watch_foo", resp.ModifiedIndex, nil, nil)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
...@@ -63,7 +63,7 @@ func TestWatchAll(t *testing.T) { ...@@ -63,7 +63,7 @@ func TestWatchAll(t *testing.T) {
go setHelper("watch_foo/foo", "bar", c) go setHelper("watch_foo/foo", "bar", c)
resp, err = c.WatchAll("watch_foo", resp.Index, nil, nil) resp, err = c.WatchAll("watch_foo", resp.ModifiedIndex, nil, nil)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment