Skip to content

Commit

Permalink
fix lockfile for the case where lockfile is provided by the user
Browse files Browse the repository at this point in the history
  • Loading branch information
m7pr committed Jul 15, 2024
1 parent d85b720 commit 8249610
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions R/teal_lockfile.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,16 @@ teal_lockfile_downloadhandler <- function() {
#' @rdname teal_lockfile
#' @keywords internal
lockfile_status <- function(process) {
renv_logs <- process$read_output()
message <- ifelse(
any(grepl("Lockfile written", renv_logs)),
"lockfile created successfully.",
"lockfile created with issues."
)
if (!is.null(process)) {
renv_logs <- process$read_output()
message <- ifelse(
any(grepl("Lockfile written", renv_logs)),
"lockfile created successfully.",
"lockfile created with issues."
)
} else {
message <- "lockfile is available."
}
logger::log_trace(message)
shiny::showNotification(message)
shinyjs::show(selector = "#teal-lockFile")
Expand All @@ -114,12 +118,11 @@ lockfile_status <- function(process) {
#' @rdname teal_lockfile
#' @keywords internal
lockfile_status_tracker <- function(process) {
checkmate::assert_class(process, "r_process")
timer <- reactiveTimer(1000)

tracker <- observe({
timer()
if (!process$is_alive()) {
if (is.null(process) || !process$is_alive()) {
lockfile_status(process)
tracker$destroy()
}
Expand Down

0 comments on commit 8249610

Please sign in to comment.