Skip to content

Commit

Permalink
repair when some workflow jobs have NA as end but not all.
Browse files Browse the repository at this point in the history
  • Loading branch information
vortexing committed Jan 21, 2022
1 parent b143dbf commit 0beb9a8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/cromwellJobs.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ cromwellJobs <- function(days = 1, workflowName = NULL, workflowStatus = NULL,
cromTable$start <- lubridate::with_tz(lubridate::ymd_hms(cromTable$start), tzone = "US/Pacific") }
if ("end" %in% colnames(cromTable) == T) {
cromTable$end <-lubridate::with_tz(lubridate::ymd_hms(cromTable$end), tzone = "US/Pacific")
cromTable$workflowDuration <- round(difftime(cromTable$end, cromTable$submission, units = "mins"),3)
}
cromTable$workflowDuration <- ifelse(is.na(cromTable$end),
round(difftime(lubridate::now(tz = "US/Pacific"), cromTable$submission, units = "mins"),3),
round(difftime(cromTable$end, cromTable$submission, units = "mins"),3))
}
if ("end" %in% colnames(cromTable) == F) {
cromTable$workflowDuration <- round(difftime(lubridate::now(tz = "US/Pacific"), cromTable$submission, units = "mins"),3)}
} else {
} else {
cromTable <- data.frame("workflow_id" = NA,
stringsAsFactors = F) }
convertToChar <- c("submission", "start", "end", "workflowDuration")
Expand Down

0 comments on commit 0beb9a8

Please sign in to comment.