Merge pull request #275 from xiangli-cmu/fix-put-ttl

Fix put ttl
This commit is contained in:
Ben Johnson
2013-10-27 10:09:26 -07:00
2 changed files with 6 additions and 5 deletions

View File

@@ -72,10 +72,11 @@ func PutHandler(w http.ResponseWriter, req *http.Request, s Server) error {
} }
c = &store.CompareAndSwapCommand{ c = &store.CompareAndSwapCommand{
Key: key, Key: key,
Value: value, Value: value,
PrevValue: prevValue, PrevValue: prevValue,
PrevIndex: prevIndex, PrevIndex: prevIndex,
ExpireTime: expireTime,
} }
return s.Dispatch(c, w, req) return s.Dispatch(c, w, req)

View File

@@ -372,8 +372,8 @@ func (n *Node) UpdateTTL(expireTime time.Time) {
} }
} }
n.ExpireTime = expireTime
if expireTime.Sub(Permanent) != 0 { if expireTime.Sub(Permanent) != 0 {
n.ExpireTime = expireTime
n.Expire() n.Expire()
} }
} }