Explorar el Código

fix get return the last modified index of the node

Xiang Li hace 12 años
padre
commit
d87e0e93d3
Se han modificado 2 ficheros con 1 adiciones y 2 borrados
  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