Skip to content

Commit c6d210d

Browse files
Try to fix the deployment 39
Signed-off-by: Lukasz Gryglicki <[email protected]>
1 parent 160a87f commit c6d210d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

cla-backend/cla/config.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
import logging
1414
import os
1515
import sys
16-
from multiprocessing.pool import ThreadPool
17-
from multiprocessing import set_start_method
1816

1917
from boto3 import client
2018
from botocore.exceptions import ClientError, ProfileNotFound, NoCredentialsError
2119

20+
from concurrent.futures import ThreadPoolExecutor
21+
2222
region = "us-east-1"
2323
ssm_client = client('ssm', region_name=region)
2424

@@ -197,11 +197,9 @@ def _load_single_key(key):
197197
]
198198

199199
# thread pool of 7 to load fetch the keys
200-
set_start_method("spawn")
201-
pool = ThreadPool(7)
202-
results = pool.map(_load_single_key, keys)
203-
pool.close()
204-
pool.join()
200+
with ThreadPoolExecutor(max_workers=7) as executor:
201+
results = list(executor.map(_load_single_key, keys))
202+
logging.warning(f"got {len(results)} keys")
205203

206204
# set the variable values at the module level so can be imported as cla.config.{VAR_NAME}
207205
for config_key, result in zip(config_keys, results):

0 commit comments

Comments
 (0)