Skip to content

Commit 97d4e5f

Browse files
committed
use context with pool
1 parent 8650ede commit 97d4e5f

File tree

1 file changed

+2
-1
lines changed
  • safegraph_patterns/delphi_safegraph_patterns

1 file changed

+2
-1
lines changed

safegraph_patterns/delphi_safegraph_patterns/run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from .process import process
1919

20+
mp.set_start_method("spawn")
2021

2122
METRICS = [
2223
# signal_name, naics_code, wip
@@ -105,7 +106,7 @@ def run_module(params):
105106
logger=logger,
106107
)
107108

108-
with mp.Pool(n_core) as pool:
109+
with mp.get_context("spawn").Pool(n_core) as pool:
109110
pool.map(process_file, files)
110111

111112
elapsed_time_in_seconds = round(time.time() - start_time, 2)

0 commit comments

Comments
 (0)