Skip to content

Commit 3b4598b

Browse files
fix windows
1 parent b57a812 commit 3b4598b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sqlmesh/utils/process.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,13 @@ def map(self, fn, *iterables, timeout=None, chunksize=1):
6161
def create_process_pool_executor(
6262
initializer: t.Callable, initargs: t.Tuple, max_workers: t.Optional[int] = c.MAX_FORK_WORKERS
6363
) -> PoolExecutor:
64-
if max_workers == 1:
64+
if max_workers == 1 or IS_WINDOWS:
6565
return SynchronousPoolExecutor(
6666
initializer=initializer,
6767
initargs=initargs,
6868
)
69-
# fork doesnt work on Windows. ref: https://docs.python.org/3/library/multiprocessing.html#multiprocessing-start-methods
70-
context_type = "spawn" if IS_WINDOWS else "fork"
7169
return ProcessPoolExecutor(
72-
mp_context=mp.get_context(context_type),
70+
mp_context=mp.get_context("fork"),
7371
initializer=initializer,
7472
initargs=initargs,
7573
max_workers=max_workers,

0 commit comments

Comments
 (0)