Browse Source

fix get return the last modified index of the node

Xiang Li 12 years ago
parent
commit
d87e0e93d3
2 changed files with 1 additions and 2 deletions
  1. 0 1
      store/node.go
  2. 1 1
      store/store.go

+ 0 - 1
store/node.go

@@ -19,7 +19,6 @@ type Node struct {
 	CreateIndex   uint64
 	CreateIndex   uint64
 	CreateTerm    uint64
 	CreateTerm    uint64
 	ModifiedIndex uint64
 	ModifiedIndex uint64
-	ModifiedTerm  uint64
 
 
 	Parent *Node `json:"-"` // should not encode this field! avoid circular dependency.
 	Parent *Node `json:"-"` // should not encode this field! avoid circular dependency.
 
 

+ 1 - 1
store/store.go

@@ -91,7 +91,7 @@ func (s *store) Get(nodePath string, recursive, sorted bool) (*Event, error) {
 		return nil, err
 		return nil, err
 	}
 	}
 
 
-	e := newEvent(Get, nodePath, s.CurrentIndex)
+	e := newEvent(Get, nodePath, n.ModifiedIndex)
 
 
 	if n.IsDir() { // node is a directory
 	if n.IsDir() { // node is a directory
 		e.Dir = true
 		e.Dir = true