summaryrefslogtreecommitdiff
path: root/src/leap/soledad/server/_blobs.py
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2017-10-11 11:20:22 -0300
committerdrebs <drebs@riseup.net>2017-10-12 14:34:11 -0300
commite0e427728848ce8bb33b4a4d6f8937ec5788d2c6 (patch)
tree7f7ddaf67cb4dbe976fdceed9fcac81eb1767251 /src/leap/soledad/server/_blobs.py
parent1cde86239f68ca8fa896ecf4ffc6b891eeb837e3 (diff)
[feature] make concurrent blob writes configurable
Diffstat (limited to 'src/leap/soledad/server/_blobs.py')
-rw-r--r--src/leap/soledad/server/_blobs.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/leap/soledad/server/_blobs.py b/src/leap/soledad/server/_blobs.py
index cd47098d..22277fc4 100644
--- a/src/leap/soledad/server/_blobs.py
+++ b/src/leap/soledad/server/_blobs.py
@@ -62,9 +62,10 @@ VALID_STRINGS = re.compile('^[a-zA-Z0-9_-]+$')
@implementer(interfaces.IIncomingBoxBackend)
class FilesystemBlobsBackend(object):
- def __init__(self, blobs_path='/tmp/blobs/', quota=200 * 1024):
+ def __init__(self, blobs_path='/tmp/blobs/', quota=200 * 1024,
+ concurrent_writes=50):
self.quota = quota
- self.semaphore = defer.DeferredSemaphore(50) # TODO: make configurable
+ self.semaphore = defer.DeferredSemaphore(concurrent_writes)
if not os.path.isdir(blobs_path):
os.makedirs(blobs_path)
self.path = blobs_path