aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-02-23 17:44:32 +0100
committerBjørn Erik Pedersen <[email protected]>2024-02-23 17:44:32 +0100
commit7ee0f70507cb33c72e8f10d2f60db205eb15e3f1 (patch)
treea01c0662219e04fd2abb6c01bc68f2b6b349f01e
parent564bae06f6513cbca80bd54411f9a66ec2115995 (diff)
downloadhugo-7ee0f70507cb33c72e8f10d2f60db205eb15e3f1.tar.gz
hugo-7ee0f70507cb33c72e8f10d2f60db205eb15e3f1.zip
Revert "cache/dynacache: Prevent multiple concurrent resizes"
This reverts commit 564bae06f6513cbca80bd54411f9a66ec2115995. Thinking about it, the above doesn't make any sense/having any effect.
-rw-r--r--cache/dynacache/dynacache.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/cache/dynacache/dynacache.go b/cache/dynacache/dynacache.go
index 0fd51590c..85b360138 100644
--- a/cache/dynacache/dynacache.go
+++ b/cache/dynacache/dynacache.go
@@ -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()