Skip to content

Commit

Permalink
Merge pull request #1625 from heinezen/fix/media_convert_timeout
Browse files Browse the repository at this point in the history
Raise errors inside multiprocessing thread
  • Loading branch information
TheJJ authored Feb 21, 2024
2 parents 3519168 + 26ae0f0 commit 13df5e7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion openage/convert/processor/export/media_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,12 @@ def _export_multithreaded(
# Small optimization that saves some time for small exports
worker_count = min(multiprocessing.cpu_count(), len(requests))

def error_callback(exception: Exception):
"""
Error callback for the worker pool.
"""
raise exception

# Create a manager for sharing data between the workers and main process
with multiprocessing.Manager() as manager:
# Workers write the image metadata to this queue
Expand Down Expand Up @@ -295,7 +301,8 @@ def _export_multithreaded(
target_path,
*itargs
),
kwds=kwargs
kwds=kwargs,
error_callback=error_callback
)

# Log file information
Expand Down

0 comments on commit 13df5e7

Please sign in to comment.