Skip to content

Commit

Permalink
option(future.delete=FALSE) now prevents the batchtools registry fold…
Browse files Browse the repository at this point in the history
…er from being deleted [#37]
  • Loading branch information
HenrikBengtsson committed May 2, 2019
1 parent f09c487 commit f113e56
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: future.batchtools
==========================

Version: 0.7.2-9000 [2019-04-25]
Version: 0.7.2-9000 [2019-05-02]

NEW FEATURES:

Expand All @@ -10,6 +10,9 @@ NEW FEATURES:
* Now a more informative error message is produced if a batchtools *.tmpl
template file was not found.

* Setting option 'future.delete' to FALSE will now prevent removal of the
batchtools registry folders.

BUG FIXES:

* Argument 'workers' could not be a function.
Expand Down
7 changes: 7 additions & 0 deletions R/BatchtoolsFuture-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,13 @@ delete.BatchtoolsFuture <- function(future,
}
}

## Have user disabled deletions?
if (!getOption("future.delete", TRUE)) {
msg <- sprintf("Option 'future.delete' is FALSE - will not delete batchtools registry: %s", sQuote(path))
mdebugf("delete(): %s", msg)
return(invisible(FALSE))
}

## Control batchtools info output
oopts <- options(batchtools.verbose = debug)
on.exit(options(oopts))
Expand Down

0 comments on commit f113e56

Please sign in to comment.