aboutsummaryrefslogtreecommitdiffhomepage
path: root/sec_certs/cert_processing.py
diff options
context:
space:
mode:
authoradamjanovsky2021-02-20 10:27:43 +0100
committerGitHub2021-02-20 10:27:43 +0100
commitbffabe69769ecd98bfb18ceb749d0ca8fd73590c (patch)
treefbe9e41c8c5f897c2738ad91a9801e14584e1711 /sec_certs/cert_processing.py
parent0fb1b04a6fbb172db6682380be34a44d68197ba3 (diff)
parentdfa21cc1921e0c05cb4a37e490697d9355d32bea (diff)
downloadsec-certs-bffabe69769ecd98bfb18ceb749d0ca8fd73590c.tar.gz
sec-certs-bffabe69769ecd98bfb18ceb749d0ca8fd73590c.tar.zst
sec-certs-bffabe69769ecd98bfb18ceb749d0ca8fd73590c.zip
Merge pull request #32 from petrs/cc_extract_certs
Cc extract certs
Diffstat (limited to 'sec_certs/cert_processing.py')
-rw-r--r--sec_certs/cert_processing.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sec_certs/cert_processing.py b/sec_certs/cert_processing.py
index 739bfa9f..b5519aab 100644
--- a/sec_certs/cert_processing.py
+++ b/sec_certs/cert_processing.py
@@ -5,13 +5,16 @@ import time
def process_parallel(func: Callable, items: Iterable, max_workers: int, callback: Optional[Callable] = None,
- use_threading: bool = True, progress_bar: bool = True):
+ use_threading: bool = True, progress_bar: bool = True, unpack: bool = False):
if use_threading is True:
pool = ThreadPool(max_workers)
else:
pool = Pool(max_workers)
- results = [pool.apply_async(func, (i, ), callback=callback) for i in items]
+ if unpack is False:
+ results = [pool.apply_async(func, (i, ), callback=callback) for i in items]
+ else:
+ results = [pool.apply_async(func, (*i, ), callback=callback) for i in items]
if progress_bar is True:
bar = tqdm(total=len(results))