reset cached bunches when flushing DeltaCoordsCache
parent
ca7d7efe7d
commit
ee8d50addd
|
@ -124,11 +124,18 @@ func (self *DeltaCoordsCache) SetLinearImport(v bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *DeltaCoordsCache) Flush() {
|
func (self *DeltaCoordsCache) Flush() {
|
||||||
|
self.mu.Lock()
|
||||||
|
defer self.mu.Unlock()
|
||||||
for bunchId, bunch := range self.table {
|
for bunchId, bunch := range self.table {
|
||||||
if bunch.needsWrite {
|
if bunch.needsWrite {
|
||||||
self.putCoordsPacked(bunchId, bunch.coords)
|
self.putCoordsPacked(bunchId, bunch.coords)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.lruList.Init()
|
||||||
|
for k, _ := range self.table {
|
||||||
|
delete(self.table, k)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
func (self *DeltaCoordsCache) Close() {
|
func (self *DeltaCoordsCache) Close() {
|
||||||
self.Flush()
|
self.Flush()
|
||||||
|
|
Loading…
Reference in New Issue