Skip to content

Commit d380b05

Browse files
committed
fixes results url
1 parent 7bd9885 commit d380b05

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

R/mod_run_model_api_calls.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ mod_run_model_submit <- function(
5454
}
5555

5656
url <- glue::glue(
57-
"{Sys.getenv('NHP_OUTPUTS_URI')}?{results$dataset}/{results$model_run_id}"
57+
Sys.getenv('NHP_OUTPUTS_URI'),
58+
"?{results$dataset}/{results$model_run_id}"
5859
)
5960
cat("results url: ", url, "\n", sep = "")
6061
results_url(url)
@@ -109,7 +110,8 @@ mod_run_model_check_container_status <- function(
109110
\(response) {
110111
res <- httr2::resp_body_json(response)
111112

112-
if (res$state == "Terminated") {
113+
state <- res$state %||% "unknown"
114+
if (state == "Terminated") {
113115
if (res$detail_status == "Completed") {
114116
cat("model run success: ", id, "\n", sep = "")
115117
status("Success")
@@ -118,7 +120,7 @@ mod_run_model_check_container_status <- function(
118120
status(glue::glue("Error running the model ({id}): {res$error}"))
119121
}
120122
return(NULL)
121-
} else if (res$state == "Creating") {
123+
} else if (state == "Creating" || state == "unknown") {
122124
# no need to change status
123125
} else {
124126
progress <- res$complete

0 commit comments

Comments
 (0)