mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fix(store.go) expire should also notify all the watchers under the path
This commit is contained in:
parent
59e98fcc62
commit
06473ba6fe
@ -512,13 +512,19 @@ func (s *store) DeleteExpiredKeys(cutoff time.Time) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
s.ttlKeyHeap.pop()
|
|
||||||
node.Remove(true, true, nil)
|
|
||||||
|
|
||||||
s.CurrentIndex++
|
s.CurrentIndex++
|
||||||
|
e := newEvent(Expire, node.Path, s.CurrentIndex, node.CreatedIndex)
|
||||||
|
|
||||||
|
callback := func(path string) { // notify function
|
||||||
|
// notify the watchers with deleted set true
|
||||||
|
s.WatcherHub.notifyWatchers(e, path, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
s.ttlKeyHeap.pop()
|
||||||
|
node.Remove(true, true, callback)
|
||||||
|
|
||||||
s.Stats.Inc(ExpireCount)
|
s.Stats.Inc(ExpireCount)
|
||||||
s.WatcherHub.notify(newEvent(Expire, node.Path, s.CurrentIndex, node.CreatedIndex))
|
s.WatcherHub.notify(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user