Skip to content

Commit 04f37e5

Browse files
Just use a sequential plan if the number of workers is 1
1 parent 0952875 commit 04f37e5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

R/mutatoRpackage.R

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,13 @@ mutate_package <- function(pkg_dir, cores = max(1, parallel::detectCores() - 2),
597597
}
598598

599599
if (length(mutants) > 0) {
600-
# Set up parallel processing
601-
future::plan(future::multisession,
602-
workers = workers_to_use
603-
)
600+
if (workers_to_use > 1) {
601+
future::plan(future::multisession,
602+
workers = workers_to_use
603+
)
604+
} else {
605+
future::plan(future::sequential)
606+
}
604607

605608
pkg_dir_list <- lapply(mutants, function(x) x$pkg)
606609
names(pkg_dir_list) <- mutant_ids

0 commit comments

Comments
 (0)