Skip to content

Commit

Permalink
more loggingpt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mzappitello committed Oct 16, 2023
1 parent 1dffdf2 commit 5da7918
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python_src/src/lamp_py/ingestion/ingest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from multiprocessing import Pool, Queue, get_context
from typing import Dict, List
import logging

from lamp_py.aws.s3 import move_s3_objects

Expand Down Expand Up @@ -94,6 +95,11 @@ def ingest_files(files: List[str], metadata_queue: Queue) -> None:
# "fork". On OSX (and Windows?) to force this behavior, run
# multiprocessing.set_start_method("fork") when starting the script.
with get_context("spawn").Pool(processes=len(converters)) as pool:
pool.map_async(run_converter, converters.values())
pool_results = pool.map_async(run_converter, converters.values())
pool.close()
pool.join()

try:
pool_results.get()
except Exception as e:
logging.exception(e)

0 comments on commit 5da7918

Please sign in to comment.