accli 1.1.2__tar.gz → 1.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: accli
3
- Version: 1.1.2
3
+ Version: 1.1.3
4
4
  Summary: IIASA Accelerator Client
5
5
  Author-email: Wrufesh S <wrufesh@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -281,7 +281,7 @@ class AcceleratorTerminalCliProjectService:
281
281
  headers = dict()
282
282
  headers["Content-Type"] = "application/octet-stream"
283
283
 
284
- part_size, part_count = 200 * 1024 ** 2, -1
284
+ part_size, part_count = 50 * 1024 ** 2, -1
285
285
 
286
286
  upload_id = None
287
287
  app_bucket_id = None
@@ -294,13 +294,21 @@ class AcceleratorTerminalCliProjectService:
294
294
  uploaded_size = 0
295
295
  put_presigned_url = None
296
296
 
297
- futures = []
298
-
299
297
  try:
300
298
 
301
299
  with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
302
300
 
301
+ active_futures = set()
302
+
303
303
  while not stop:
304
+ if len(active_futures) >= max_workers:
305
+ done, active_futures = concurrent.futures.wait(
306
+ active_futures,
307
+ return_when=concurrent.futures.FIRST_COMPLETED
308
+ )
309
+ for f in done:
310
+ parts.append(f.result())
311
+
304
312
  part_number += 1
305
313
  part_data = self.read_part_data(
306
314
  file_stream,
@@ -331,14 +339,16 @@ class AcceleratorTerminalCliProjectService:
331
339
  # headers=headers
332
340
  )
333
341
 
334
- future = executor.submit(self.put_part, project_slug, app_bucket_id, uniqified_filename, upload_id,
335
- part_number, part_data, progress, task)
336
-
337
- futures.append(future)
338
-
339
- futures_results = concurrent.futures.wait(futures, return_when=concurrent.futures.ALL_COMPLETED)
342
+ future = executor.submit(
343
+ self.put_part, project_slug, app_bucket_id, uniqified_filename,
344
+ upload_id, part_number, part_data, progress, task
345
+ )
346
+ active_futures.add(future)
340
347
 
341
- parts = [f.result() for f in futures_results.done]
348
+ if active_futures:
349
+ done, _ = concurrent.futures.wait(active_futures, return_when=concurrent.futures.ALL_COMPLETED)
350
+ for f in done:
351
+ parts.append(f.result())
342
352
 
343
353
  parts.sort(key=lambda x: x[0])
344
354
 
@@ -1,3 +1,3 @@
1
1
  # Please strictly put double quote to use this info for git tag
2
2
  # Read a developer guide for git tag command with regex
3
- VERSION = "v1.1.2"
3
+ VERSION = "v1.1.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: accli
3
- Version: 1.1.2
3
+ Version: 1.1.3
4
4
  Summary: IIASA Accelerator Client
5
5
  Author-email: Wrufesh S <wrufesh@gmail.com>
6
6
  License: The MIT License (MIT)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes