Add mutex lock file path to registry CLI wrapper class (#958)

Part of [Service provider auctions for web deployments](https://www.notion.so/Service-provider-auctions-for-web-deployments-104a6b22d47280dbad51d28aa3a91d75)
Follows cerc-io/stack-orchestrator#957

Reviewed-on: cerc-io/stack-orchestrator#958
Reviewed-by: ashwin <ashwin@noreply.git.vdb.to>
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
Prathamesh Musale 2024-10-28 06:03:13 +00:00 committed by ashwin
parent 4a7df2de33
commit 5f8e809b2d
2 changed files with 3 additions and 2 deletions

View File

@ -10,7 +10,7 @@ def registry_mutex():
@wraps(func)
def wrapper(self, *args, **kwargs):
lock_file_path = DEFAULT_LOCK_FILE_PATH
if self.mutex_lock_file is not None:
if self.mutex_lock_file:
lock_file_path = self.mutex_lock_file
with open(lock_file_path, 'w') as lock_file:

View File

@ -114,9 +114,10 @@ def is_id(name_or_id: str):
class LaconicRegistryClient:
def __init__(self, config_file, log_file=None):
def __init__(self, config_file, log_file=None, mutex_lock_file=None):
self.config_file = config_file
self.log_file = log_file
self.mutex_lock_file = mutex_lock_file
self.cache = AttrDict(
{
"name_or_id": {},