Skip to content

Commit

Permalink
Update agency_config_lock_manager.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bonk1t authored Dec 10, 2023
1 parent 1e33730 commit 2b3080d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/nalgonda/agency_config_lock_manager.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import threading

from collections import defaultdict

class AgencyConfigLockManager:
"""Lock manager for agency config files"""

_locks: dict[str, threading.Lock] = {}
_locks: dict[str, threading.Lock] = defaultdict(threading.Lock)

@classmethod
def get_lock(cls, agency_id):
if agency_id not in cls._locks:
cls._locks[agency_id] = threading.Lock()
return cls._locks[agency_id]

0 comments on commit 2b3080d

Please sign in to comment.