Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit 1ce98e2

Browse files
committed
add deleteJob option to foreach, by default it is true for wait=TRUE job
1 parent 2afb05d commit 1ce98e2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

R/doAzureParallel.R

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ setHttpTraffic <- function(value = FALSE) {
232232
wait <- obj$options$azure$wait
233233
}
234234

235+
deleteJob <- TRUE
236+
if (!is.null(obj$options$azure$deleteJob)) {
237+
wait <- obj$options$azure$deleteJob
238+
}
239+
235240
inputs <- FALSE
236241
if (!is.null(obj$options$azure$inputs)) {
237242
storageCredentials <- rAzureBatch::getStorageCredentials()
@@ -584,7 +589,10 @@ setHttpTraffic <- function(value = FALSE) {
584589
cat(sprintf("Number of errors: %i", numberOfFailedTasks),
585590
fill = TRUE)
586591

587-
rAzureBatch::deleteJob(id)
592+
# delete job from batch service and job result from storage blob
593+
if(deleteJob) {
594+
deleteJob(id)
595+
}
588596

589597
if (identical(obj$errorHandling, "stop") &&
590598
!is.null(errorValue)) {

0 commit comments

Comments
 (0)