diff options
author | drebs <drebs@leap.se> | 2016-05-02 20:45:46 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2016-05-03 10:52:26 -0300 |
commit | e1cc83b7a8b66d3a0dabacc9c6dfd83869ad2054 (patch) | |
tree | ea67fa498c706fda7d539a9f25e512e54af42fbb | |
parent | 96dfd54e057875e52e22309b73e58ad4d1ea02a5 (diff) |
[bug] fix semaphore parameters
-rw-r--r-- | client/src/leap/soledad/client/adbapi.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/src/leap/soledad/client/adbapi.py b/client/src/leap/soledad/client/adbapi.py index c2fbb06e..cfd7675c 100644 --- a/client/src/leap/soledad/client/adbapi.py +++ b/client/src/leap/soledad/client/adbapi.py @@ -204,7 +204,7 @@ class U1DBConnectionPool(adbapi.ConnectionPool): :rtype: twisted.internet.defer.Deferred """ meth = "u1db_%s" % meth - semaphore = DeferredSemaphore(SQLCIPHER_MAX_RETRIES - 1) + semaphore = DeferredSemaphore(SQLCIPHER_MAX_RETRIES) def _run_interaction(): return self.runInteraction( @@ -213,7 +213,7 @@ class U1DBConnectionPool(adbapi.ConnectionPool): def _errback(failure): failure.trap(OperationalError) if failure.getErrorMessage() == "database is locked": - should_retry = semaphore.acquire(False) + should_retry = semaphore.acquire() if should_retry: logger.warning( "Database operation timed out while waiting for " |