mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fix bug in update ttl
This commit is contained in:
parent
49c55477e5
commit
779195eb4f
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user