From 931cf2992e186c390f509c865aa26f97151521a6 Mon Sep 17 00:00:00 2001 From: Son Roy Almerol Date: Sun, 22 Dec 2024 17:26:31 -0500 Subject: [PATCH] remove unnecessary concurrency locks --- store/concurrency.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/store/concurrency.go b/store/concurrency.go index 71b4823..05204e0 100644 --- a/store/concurrency.go +++ b/store/concurrency.go @@ -41,9 +41,6 @@ func (cm *ConcurrencyManager) GetCount(m3uIndex string) int { } func (cm *ConcurrencyManager) ConcurrencyPriorityValue(m3uIndex string) int { - cm.mu.Lock() - defer cm.mu.Unlock() - maxConcurrency, err := strconv.Atoi(os.Getenv(fmt.Sprintf("M3U_MAX_CONCURRENCY_%s", m3uIndex))) if err != nil { maxConcurrency = 1 @@ -55,9 +52,6 @@ func (cm *ConcurrencyManager) ConcurrencyPriorityValue(m3uIndex string) int { } func (cm *ConcurrencyManager) CheckConcurrency(m3uIndex string) bool { - cm.mu.Lock() - defer cm.mu.Unlock() - maxConcurrency, err := strconv.Atoi(os.Getenv(fmt.Sprintf("M3U_MAX_CONCURRENCY_%s", m3uIndex))) if err != nil { maxConcurrency = 1 @@ -70,9 +64,6 @@ func (cm *ConcurrencyManager) CheckConcurrency(m3uIndex string) bool { } func (cm *ConcurrencyManager) UpdateConcurrency(m3uIndex string, incr bool) { - cm.mu.Lock() - defer cm.mu.Unlock() - if incr { cm.Increment(m3uIndex) } else {