Spaces:
Runtime error
Runtime error
reduce the number of messages upon failure.
Browse files
app.R
CHANGED
@@ -95,7 +95,7 @@ server <- function(input, output, session) {
|
|
95 |
# Observer used at app startup time to allow using the 'Send' button once the
|
96 |
# model has been loaded.
|
97 |
observe({
|
98 |
-
if (sess$is_loaded) return()
|
99 |
cat("Loading model:",sess$sess$poll_process(), "\n")
|
100 |
invalidateLater(1000, session)
|
101 |
|
@@ -107,6 +107,7 @@ server <- function(input, output, session) {
|
|
107 |
}, onRejected = function(x) {
|
108 |
shinyjs::disable("send")
|
109 |
insert_message(paste0("😭 Error loading the model:\n", as.character(x)))
|
|
|
110 |
})
|
111 |
|
112 |
NULL # we return NULL so we don't stuck waiting for the above.
|
|
|
95 |
# Observer used at app startup time to allow using the 'Send' button once the
|
96 |
# model has been loaded.
|
97 |
observe({
|
98 |
+
if (is.null(self$is_loaded) || sess$is_loaded) return()
|
99 |
cat("Loading model:",sess$sess$poll_process(), "\n")
|
100 |
invalidateLater(1000, session)
|
101 |
|
|
|
107 |
}, onRejected = function(x) {
|
108 |
shinyjs::disable("send")
|
109 |
insert_message(paste0("😭 Error loading the model:\n", as.character(x)))
|
110 |
+
self$is_loaded <- NULL # means failure!
|
111 |
})
|
112 |
|
113 |
NULL # we return NULL so we don't stuck waiting for the above.
|