Browse Source

Merge pull request #5683 from xiang90/fix_refresh

store: copy old value when refresh + cas
Xiang Li 9 years ago
parent
commit
bc69142940
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
 		return nil, err
 	}
 	}
 
 
+	if expireOpts.Refresh {
+		value = n.Value
+	}
+
 	// update etcd index
 	// update etcd index
 	s.CurrentIndex++
 	s.CurrentIndex++