Skip to content

Commit 72a7baf

Browse files
New interruptFuture() did not muffle 'batchtools' output [#96, #27]
1 parent cb668b0 commit 72a7baf

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future.batchtools
2-
Version: 0.12.2-9910
2+
Version: 0.12.2-9911
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

R/BatchtoolsFuture-class.R

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,19 @@ interruptFuture.BatchtoolsFutureBackend <- function(backend, future, ...) {
366366
jobid <- config[["jobid"]]$job.id
367367
if (debug) mdebugf("Job ID: %s", jobid)
368368

369-
res <- killJobs(ids = jobid, reg = reg)
369+
res <- local({
370+
## Temporarily disable batchtools output?
371+
## (i.e. messages and progress bars)
372+
batchtools_output <- getOption("future.batchtools.output", debug)
373+
if (!batchtools_output) {
374+
oopts <- options(batchtools.verbose = FALSE, batchtools.progress = FALSE)
375+
} else {
376+
oopts <- list()
377+
}
378+
on.exit(options(oopts), add = TRUE)
379+
killJobs(ids = jobid, reg = reg)
380+
})
381+
370382
if (debug) {
371383
mdebug("killJobs() result:")
372384
mprint(res)

0 commit comments

Comments
 (0)