Skip to content

Commit 8f19341

Browse files
committed
Added max function to make sure the thread_cnt is at least 1
1 parent 7fd2298 commit 8f19341

File tree

1 file changed

+1
-1
lines changed
  • solutions/macie/macie-org/code/src

1 file changed

+1
-1
lines changed

solutions/macie/macie-org/code/src/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def check_available_regions(service_regions: list) -> list:
111111
try:
112112
thread_cnt = MAX_THREADS
113113
if MAX_THREADS > len(service_regions):
114-
thread_cnt = len(service_regions) - 2
114+
thread_cnt = max(len(service_regions) - 2, 1)
115115

116116
processes = []
117117
with ThreadPoolExecutor(max_workers=thread_cnt) as executor:

0 commit comments

Comments
 (0)