diff --git a/R/build-metadata.R b/R/build-metadata.R index 1accb97..4e08791 100644 --- a/R/build-metadata.R +++ b/R/build-metadata.R @@ -45,12 +45,6 @@ store_build_metadata <- function( dbWriteTable(con, "single_builds", metadata, append = TRUE) } - # here we check if build_duration is empty and take this as an indicator that the build failed. I.e. we set error_occurred = TRUE - val <- dbGetQuery(con, sprintf("SELECT build_duration FROM single_builds WHERE package_name = '%s' and tag = '%s'", package_name, tag)) - if (is.na(val)) { - dbExecute(con, sprintf("UPDATE single_builds SET error_occurred = TRUE WHERE package_name = '%s' and tag = '%s'", package_name, tag)) - } - # Close the SQLite connection dbDisconnect(con) diff --git a/R/build_binaries.R b/R/build_binaries.R index 60292b6..a4be691 100644 --- a/R/build_binaries.R +++ b/R/build_binaries.R @@ -90,6 +90,17 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL, p() store_build_metadata(x, y, platform, error_occurred = FALSE, force = force) dump <- build_single_tag(x, y, dir_out_bin, local_clone_dir, platform = platform, debug = debug) + + con <- DBI::dbConnect(RPostgres::Postgres(), + dbname = "build_metadata", host = "postgres-arm-binaries-r.devxy.io", + port = 15432, user = "arm_binaries", password = Sys.getenv("PGPASS") + ) + # here we check if build_duration is empty and take this as an indicator that the build failed. I.e. we set error_occurred = TRUE + val <- dbGetQuery(con, sprintf("SELECT build_duration FROM single_builds WHERE package_name = '%s' and tag = '%s'", x, y)) + if (is.na(val)) { + dbExecute(con, sprintf("UPDATE single_builds SET error_occurred = TRUE WHERE package_name = '%s' and tag = '%s'", x, y)) + } + dbDisconnect(con) }, error = function(e) { message(sprintf("Error in processing package %s with tag %s: %s", x, y, e))