Skip to content

Commit 7ce5373

Browse files
committed
frollapply: let the interrupt continue
Instead of calling invokeRestart("abort") in the interrupt handler, return from it. This continues the dispatch of the interrupt and lets an outer handler catch it: tryCatch( frollapply(1:1e6, 1, \(.) { Sys.sleep(ret <- sum(.)); ret}), interrupt = \(e) 'interrupted' ) ^C[1] "interrupted" With invokeRestart("abort"), the interrupt cannot be handled further.
1 parent 992b389 commit 7ce5373

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/frollapply.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@ frollapply = function(X, N, FUN, ..., by.column=TRUE, fill=NA, align=c("right","
414414
lapply(jobs, function(pid) try(tools::pskill(pid), silent = TRUE))
415415
parallel::mccollect(jobs, wait = FALSE)
416416
})
417-
invokeRestart("abort") ## raise SIGINT
418417
# nocov end
418+
# Let the interrupt continue without invoking restarts
419419
}
420420
)
421421
## check for any errors in FUN, warnings are silently ignored

0 commit comments

Comments
 (0)