From 779195eb4fd741a2f29ddbd46531d2fe8a5db553 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 5 Nov 2013 22:18:54 -0800 Subject: [PATCH] fix bug in update ttl --- store/node.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/store/node.go b/store/node.go index b3daa1dfc..33ae76692 100644 --- a/store/node.go +++ b/store/node.go @@ -286,6 +286,7 @@ func (n *Node) UpdateTTL(expireTime time.Time) { n.store.ttlKeyHeap.remove(n) } else { // update ttl + n.ExpireTime = expireTime // update ttl heap n.store.ttlKeyHeap.update(n) } @@ -293,12 +294,11 @@ func (n *Node) UpdateTTL(expireTime time.Time) { } else { if !expireTime.IsZero() { // from permanent to ttl + n.ExpireTime = expireTime // push into ttl heap n.store.ttlKeyHeap.push(n) } } - - n.ExpireTime = expireTime } // Clone function clone the node recursively and return the new node.