Skip to content

Commit

Permalink
Fail early in poll()
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed May 15, 2023
1 parent d696d43 commit 57c8174
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Description: In computationally demanding analysis projects,
'clustermq' by Schubert (2019) <doi:10.1093/bioinformatics/btz284>),
and 'batchtools' by Lang, Bischel, and Surmann (2017)
<doi:10.21105/joss.00135>.
Version: 0.1.1.9006
Version: 0.1.1.9008
License: MIT + file LICENSE
URL: https://wlandau.github.io/crew/, https://github.com/wlandau/crew
BugReports: https://github.com/wlandau/crew/issues
Expand Down
12 changes: 10 additions & 2 deletions R/crew_router.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,18 @@ crew_class_router <- R6::R6Class(
#' of high-level worker-specific statistics.
#' @return `NULL` (invisibly).
poll = function() {
if (!isTRUE(self$started)) {
return(invisible())
}
out <- mirai::daemons(.compute = self$name)$daemons
if (daemons_valid(out)) {
self$daemons <- out
# Should not happen:
# nocov start
if (!daemons_valid(out)) {
message <- paste(c("invalid daemons:", deparse1(out)), collapse = " ")
crew_error(message)
}
# nocov end
self$daemons <- out
invisible()
},
#' @description Show an informative worker log.
Expand Down

0 comments on commit 57c8174

Please sign in to comment.