Skip to content

Commit 90dc6d2

Browse files
committed
map workers value to env var, i hope this is easier to deal with
1 parent af067b3 commit 90dc6d2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

core/controller.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,21 @@ def run(
238238
recursive: bool,
239239
dropzone: bool,
240240
language: str,
241+
workers: int,
241242
) -> None:
242243
# Main function, convert media files to defined formats
243244
# or merge or concatenate, according to the arguments
244245
input_paths = []
246+
# Apply worker override via environment for converters
247+
try:
248+
if workers is not None:
249+
# Workers flag was set, do some validation, hand it to env
250+
os.environ["A2A_MAX_WORKERS"] = str(max(1, int(workers)))
251+
except Exception:
252+
# Ignore invalid values; converters will fall back to CPU-based default
253+
pass
254+
255+
# Apply input paths
245256
input_path_args = (
246257
input_path_args
247258
if input_path_args is not None

0 commit comments

Comments
 (0)