Commit cccff590 authored by Stavros Sachtouris's avatar Stavros Sachtouris

Thread limit can be set by user

parent cad39033
......@@ -622,7 +622,7 @@ class store_upload(_store_container_command):
remote_path = local_path if self.path is None else self.path
poolsize = self.get_argument('poolsize')
if poolsize is not None:
self.POOL_SIZE = poolsize
self.client.POOL_SIZE = int(poolsize)
params = dict(content_encoding=self.get_argument('content_encoding'),
content_type=self.get_argument('content_type'),
content_disposition=self.get_argument('content_disposition'),
......@@ -735,7 +735,7 @@ class store_download(_store_container_command):
download_cb = progress_bar.get_generator('Downloading')
poolsize = self.get_argument('poolsize')
if poolsize is not None:
self.POOL_SIZE = int(poolsize)
self.client.POOL_SIZE = int(poolsize)
try:
self.client.download_object(self.path, out,
......
......@@ -69,7 +69,7 @@ class ClientError(Exception):
class Client(object):
POOL_SIZE = 5
POOL_SIZE = 7
def __init__(self, base_url, token, http_client=KamakiHTTPConnection()):
self.base_url = base_url
......
......@@ -392,8 +392,6 @@ class PithosClient(PithosRestAPI):
blocks will be written to normal_position - 10"""
finished = []
for i, (start, g) in enumerate(flying.items()):
#if i % self.POOL_SIZE == 0:
# g.join(0.1)
if not g.isAlive():
if g.exception:
raise g.exception
......@@ -494,8 +492,6 @@ class PithosClient(PithosRestAPI):
range,
**restargs)
else:
if len(remote_hashes) > self.POOL_SIZE:
self.POOL_SIZE = len(remote_hashes) // 10
self._dump_blocks_async(obj,
remote_hashes,
blocksize,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment