no progressr

This commit is contained in:
Patrick Schratz 2024-08-28 11:43:48 +02:00
commit 2aecc2ca20
Signed by: pat-s
GPG key ID: 3C6318841EF78925
2 changed files with 9 additions and 9 deletions

View file

@ -84,15 +84,15 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
cli::cli_alert("Building binaries for {.pkg {package_name[[1]]}} with tags {.field {tag}}.") cli::cli_alert("Building binaries for {.pkg {package_name[[1]]}} with tags {.field {tag}}.")
# Set up the progress handler # Set up the progress handler
progressr::handlers(global = TRUE) # progressr::handlers(global = TRUE)
progressr::handlers("cli", "debug") # progressr::handlers("cli", "debug")
out <- progressr::with_progress({ # out <- progressr::with_progress({
p <- progressr::progressor(along = tag) # p <- progressr::progressor(along = tag)
future.apply::future_mapply(function(x, y) { future.apply::future_mapply(function(x, y) {
tryCatch( tryCatch(
{ {
p() # p()
dump <- build_single_tag(x, y, dir_out_bin, local_clone_dir, platform = platform, debug = debug, force = force) dump <- build_single_tag(x, y, dir_out_bin, local_clone_dir, platform = platform, debug = debug, force = force)
# if for some reason an underlying error didnt' get caught in the tryCatch calls, we check again here for the existence of the binary file on disk and mark the build as failed if it is not found # if for some reason an underlying error didnt' get caught in the tryCatch calls, we check again here for the existence of the binary file on disk and mark the build as failed if it is not found
@ -113,7 +113,7 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
} }
) )
}, package_name, tag, future.seed = TRUE) }, package_name, tag, future.seed = TRUE)
}) # })
total_build_time <- round(Sys.time() - t1, 2) total_build_time <- round(Sys.time() - t1, 2)
cli::cli_alert("Execution time ({.pkg {package_name[[1]]}}) ({length(tag)} tags): {.strong {total_build_time} {units(difftime(Sys.time(), t1))}}.") cli::cli_alert("Execution time ({.pkg {package_name[[1]]}}) ({length(tag)} tags): {.strong {total_build_time} {units(difftime(Sys.time(), t1))}}.")

View file

@ -31,7 +31,7 @@ process_cran_updates <- function(
all_pkgs <- dplyr::bind_rows(updated_pkgs, new_pkgs) all_pkgs <- dplyr::bind_rows(updated_pkgs, new_pkgs)
purrr::walk2(all_pkgs$name, all_pkgs$version, ~ build_binary_package(.x, .y, platform = platform)) # purrr::walk2(all_pkgs$name, all_pkgs$version, ~ build_binary_package(.x, .y, platform = platform))
if (prune) { if (prune) {
removed_pkgs <- get_removed_cran_packages(interval) removed_pkgs <- get_removed_cran_packages(interval)
@ -57,8 +57,8 @@ process_cran_updates <- function(
purrr::walk(removed_pkgs$name, ~ { purrr::walk(removed_pkgs$name, ~ {
cli::cli_alert("{.fun process_cran_updates}: Removing package {.pkg {.x}} from S3.") cli::cli_alert("{.fun process_cran_updates}: Removing package {.pkg {.x}} from S3.")
files_filtered <- grep("bold_", files, value = TRUE) files_filtered <- grep(sprintf("%s_", .x), files, value = TRUE)
s3fs::s3_file_delete_async(files_filtered) s3fs::s3_file_delete(files_filtered)
cli::cli_alert_success("{.fun process_cran_updates}: Successfully removed {.pkg {basename(files_filtered)}} from S3.") cli::cli_alert_success("{.fun process_cran_updates}: Successfully removed {.pkg {basename(files_filtered)}} from S3.")
}) })