On delete, always set promotions == -2 and node == nil
Also, item.promotions doesn't need to be loaded/stored using atomic. Once upon a time it did. Cache was updated long ago to not use atomic operations on it, but LayeredCache wasn't. They are both consistent now (they don't use atomic operations). Fixes: https://github.com/karlseguin/ccache/issues/76
This commit is contained in:
@@ -391,7 +391,7 @@ func Test_LayeredCachePrune(t *testing.T) {
|
||||
cache.Set(key, key, key, 5*time.Minute)
|
||||
}
|
||||
if epoch%500 == 0 {
|
||||
assert.True(t, cache.GetSize() < 500)
|
||||
assert.True(t, cache.GetSize() <= 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user