Browse Source

store: use nextIndex where necessary

Jonathan Boulle 11 years ago
parent
commit
b15fefa8ea
1 changed files with 2 additions and 2 deletions
  1. 2 2
      store/store.go

+ 2 - 2
store/store.go

@@ -275,7 +275,7 @@ func (s *store) Delete(nodePath string, dir, recursive bool) (*Event, error) {
 
 
 	nextIndex := s.CurrentIndex + 1
 	nextIndex := s.CurrentIndex + 1
 	e := newEvent(Delete, nodePath, nextIndex, n.CreatedIndex)
 	e := newEvent(Delete, nodePath, nextIndex, n.CreatedIndex)
-	e.EtcdIndex = s.CurrentIndex
+	e.EtcdIndex = nextIndex
 	e.PrevNode = n.Repr(false, false)
 	e.PrevNode = n.Repr(false, false)
 	eNode := e.Node
 	eNode := e.Node
 
 
@@ -414,7 +414,7 @@ func (s *store) Update(nodePath string, newValue string, expireTime time.Time) (
 	}
 	}
 
 
 	e := newEvent(Update, nodePath, nextIndex, n.CreatedIndex)
 	e := newEvent(Update, nodePath, nextIndex, n.CreatedIndex)
-	e.EtcdIndex = s.CurrentIndex
+	e.EtcdIndex = nextIndex
 	e.PrevNode = n.Repr(false, false)
 	e.PrevNode = n.Repr(false, false)
 	eNode := e.Node
 	eNode := e.Node