improve detection for failed builds

This commit is contained in:
Patrick Schratz 2024-07-24 22:08:43 +02:00
commit 0facfb0556
Signed by: pat-s
GPG key ID: 3C6318841EF78925

View file

@ -45,6 +45,12 @@ 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)