Explorar el Código

store: copy old value when refresh + cas

Xiang Li hace 9 años
padre
commit
df56f9d6f9
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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++