fix: audit workflows
Some checks failed
ci/crow/manual/weekly-audit-missing-alpine-322-arm64 Pipeline failed
Some checks failed
ci/crow/manual/weekly-audit-missing-alpine-322-arm64 Pipeline failed
This commit is contained in:
parent
dfad39ebf1
commit
7c9a82187d
1 changed files with 32 additions and 9 deletions
|
|
@ -118,15 +118,36 @@ if (file.exists(excluded_path)) {
|
|||
# 5. Query PostgreSQL for known build failures
|
||||
# ---------------------------------------------------------------------------
|
||||
cat("Connecting to PostgreSQL...\n")
|
||||
con <- DBI::dbConnect(
|
||||
RPostgres::Postgres(),
|
||||
dbname = "build_metadata",
|
||||
host = "r-binaries.devxy.io",
|
||||
port = 15432,
|
||||
user = "rpkgs",
|
||||
password = Sys.getenv("PGPASS"),
|
||||
sslmode = "require"
|
||||
)
|
||||
pg_connect <- function() {
|
||||
DBI::dbConnect(
|
||||
RPostgres::Postgres(),
|
||||
dbname = "build_metadata",
|
||||
host = "r-binaries.devxy.io",
|
||||
port = 15432,
|
||||
user = "rpkgs",
|
||||
password = Sys.getenv("PGPASS"),
|
||||
sslmode = "require"
|
||||
)
|
||||
}
|
||||
|
||||
con <- NULL
|
||||
for (attempt in seq_len(3)) {
|
||||
con <- tryCatch(pg_connect(), error = function(e) NULL)
|
||||
if (!is.null(con) && DBI::dbIsValid(con)) {
|
||||
tryCatch({
|
||||
DBI::dbGetQuery(con, "SELECT 1")
|
||||
break
|
||||
}, error = function(e) {
|
||||
try(DBI::dbDisconnect(con), silent = TRUE)
|
||||
con <<- NULL
|
||||
})
|
||||
}
|
||||
if (attempt < 3) {
|
||||
cat(sprintf("PostgreSQL connection attempt %d failed, retrying...\n", attempt))
|
||||
Sys.sleep(2 * attempt)
|
||||
}
|
||||
}
|
||||
if (is.null(con) || !DBI::dbIsValid(con)) stop("Failed to connect to PostgreSQL after 3 attempts")
|
||||
on.exit(DBI::dbDisconnect(con), add = TRUE)
|
||||
|
||||
errored_pkgs <- DBI::dbGetQuery(
|
||||
|
|
|
|||
Loading…
Reference in a new issue