From 139528ec20cd5fa840e98ec19a03b5c642ce995d Mon Sep 17 00:00:00 2001 From: drebs Date: Tue, 8 Jul 2014 10:44:38 -0300 Subject: Fix sqlcipher db syncing property. --- client/src/leap/soledad/client/sqlcipher.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'client/src') diff --git a/client/src/leap/soledad/client/sqlcipher.py b/client/src/leap/soledad/client/sqlcipher.py index 46ceca42..38d5e7ec 100644 --- a/client/src/leap/soledad/client/sqlcipher.py +++ b/client/src/leap/soledad/client/sqlcipher.py @@ -480,13 +480,11 @@ class SQLCipherDatabase(sqlite_backend.SQLitePartialExpandDatabase): @property def syncing(self): - syncing = False - for url in self._syncers: - _, _, lock = self._syncers[url] - is_not_locked = lock.acquire(blocking=False) - if is_not_locked is False: - return True - lock.release() + lock = SQLCipherDatabase.syncing_lock[self._get_replica_uid()] + acquired_lock = lock.acquire(False) + if acquired_lock is False: + return True + lock.release() return False def _get_syncer(self, url, creds=None): -- cgit v1.2.3