Преглед изворни кода

Merge pull request #5683 from xiang90/fix_refresh

store: copy old value when refresh + cas
Xiang Li пре 9 година
родитељ
комит
bc69142940
1 измењених фајлова са 4 додато и 0 уклоњено
  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++