fix put ttl

This commit is contained in:
Xiang Li 2013-10-26 21:04:44 -07:00
parent 63456b5c4b
commit 1fb3799118
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()
} }
} }