Skip to content

Commit

Permalink
remove unnecessary concurrency locks
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol committed Dec 22, 2024
1 parent 30a03da commit 931cf29
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions store/concurrency.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 931cf29

Please sign in to comment.