test + fix for actual size function
This commit is contained in:
@@ -160,10 +160,10 @@ func (c *LayeredCache) worker() {
|
||||
c.gc()
|
||||
}
|
||||
case item := <-c.deletables:
|
||||
atomic.AddInt64(&c.size, -item.size)
|
||||
if item.element == nil {
|
||||
item.promotions = -2
|
||||
} else {
|
||||
atomic.AddInt64(&c.size, -item.size)
|
||||
c.list.Remove(item.element)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user