fix crash in some times

This commit is contained in:
YouROK
2021-06-30 22:08:59 +03:00
parent a75c05398e
commit 6209f03ade

View File

@@ -121,12 +121,14 @@ func (c *Cache) AdjustRA(readahead int64) {
if settings.BTsets.CacheSize == 0 {
c.capacity = readahead * 3
}
if len(c.readers) > 0 {
c.muReaders.Lock()
for r, _ := range c.readers {
r.SetReadahead(readahead)
}
c.muReaders.Unlock()
}
}
func (c *Cache) GetState() *state.CacheState {
cState := new(state.CacheState)