Revert "cache/dynacache: Prevent multiple concurrent resizes"

This reverts commit 564bae06f6.

Thinking about it, the above doesn't make any sense/having any effect.
This commit is contained in:
Bjørn Erik Pedersen 2024-02-23 17:44:32 +01:00
parent 564bae06f6
commit 7ee0f70507
No known key found for this signature in database

View file

@ -119,8 +119,7 @@ func (o OptionsPartition) CalculateMaxSize(maxSizePerPartition int) int {
// A dynamic partitioned cache.
type Cache struct {
mu sync.RWMutex
resizeMu sync.Mutex
mu sync.RWMutex
partitions map[string]PartitionManager
@ -232,12 +231,6 @@ func (c *Cache) Stop() {
}
func (c *Cache) adjustCurrentMaxSize() {
if !c.resizeMu.TryLock() {
// Prevent multiple concurrent resizes.
return
}
defer c.resizeMu.Unlock()
c.mu.RLock()
defer c.mu.RUnlock()