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

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