From: Baha Mesleh Date: Tue, 11 Jun 2019 13:00:06 +0000 (+0300) Subject: A fix for the DB synchronization after a restart X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ta%2Flockcli.git;a=commitdiff_plain;h=54aed66cdaef170ffbfdcb511ced241f4be14555 A fix for the DB synchronization after a restart Changed the lockcli to wait for the shared lock to be released. Signed-off-by: Baha Mesleh Change-Id: Ibb3c603cf58cc03e0558a2452288bb610ed18d7d --- diff --git a/src/lockcli/handlers.py b/src/lockcli/handlers.py index efc911c..36b5eee 100644 --- a/src/lockcli/handlers.py +++ b/src/lockcli/handlers.py @@ -72,7 +72,7 @@ class CLILockHandler(CLIHandler): def __call__(self, args): self._init_api(args.server, args.port, args.verbose) lock = etcd.Lock(self.client, args.id) - result = lock.acquire(blocking=False, lock_ttl=args.timeout) + result = lock.acquire(blocking=True, lock_ttl=args.timeout) if not result: raise Exception('Lock taken!')