Merge pull request #680 from seebs/cachefix

when updating a container, drop the single-container cache
This commit is contained in:
seebs 2020-08-17 15:03:10 -05:00 committed by GitHub
commit 4f7e4feaf8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -189,6 +189,8 @@ func (btc *bTreeContainers) Repair() {
// replace the given container.
func (btc *bTreeContainers) Update(key uint64, fn func(*Container, bool) (*Container, bool)) {
btc.tree.Put(key, fn)
btc.lastKey = ^uint64(0)
btc.lastContainer = nil
}
// UpdateEvery calls fn (existing-container, existed), and expects

View file

@ -210,6 +210,7 @@ func (sc *sliceContainers) Update(key uint64, fn func(*Container, bool) (*Contai
sc.insertAt(key, nc, i)
}
}
sc.invalidateCache()
}
// UpdateEvery calls fn (existing-container, existed), and expects