mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #6782 from xiang90/v2store
store: do not modify key during scanning
This commit is contained in:
commit
71bad561e8
@ -83,12 +83,12 @@ func (eh *EventHistory) scan(key string, recursive bool, index uint64) (*Event,
|
|||||||
|
|
||||||
if recursive {
|
if recursive {
|
||||||
// add tailing slash
|
// add tailing slash
|
||||||
key = path.Clean(key)
|
nkey := path.Clean(key)
|
||||||
if key[len(key)-1] != '/' {
|
if nkey[len(nkey)-1] != '/' {
|
||||||
key = key + "/"
|
nkey = nkey + "/"
|
||||||
}
|
}
|
||||||
|
|
||||||
ok = ok || strings.HasPrefix(e.Node.Key, key)
|
ok = ok || strings.HasPrefix(e.Node.Key, nkey)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.Action == Delete || e.Action == Expire) && e.PrevNode != nil && e.PrevNode.Dir {
|
if (e.Action == Delete || e.Action == Expire) && e.PrevNode != nil && e.PrevNode.Dir {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user