Browse Source

store: copy old value when refresh + cas

Xiang Li 9 years ago
parent
commit
df56f9d6f9
1 changed files with 4 additions and 0 deletions
  1. 4 0
      store/store.go

+ 4 - 0
store/store.go

@@ -298,6 +298,10 @@ func (s *store) CompareAndSwap(nodePath string, prevValue string, prevIndex uint
 		return nil, err
 	}
 
+	if expireOpts.Refresh {
+		value = n.Value
+	}
+
 	// update etcd index
 	s.CurrentIndex++