always inject error as character into DB
This commit is contained in:
parent
464a473a6b
commit
af04f7938e
1 changed files with 17 additions and 7 deletions
|
|
@ -13,12 +13,16 @@ store_build_metadata <- function(
|
|||
package_name, "' AND tag = '", tag, "'"
|
||||
))
|
||||
|
||||
if (is.null(error)) {
|
||||
error <- NA
|
||||
}
|
||||
|
||||
if (nrow(existing_entries) >= 1 && !force) {
|
||||
cli::cli_alert("{.fun store_build_metadata}: Build metadata for {.field {.pkg package_name}} {.field {tag}} already exists.")
|
||||
} else if (nrow(existing_entries) >= 1 && force) {
|
||||
cli::cli_alert_info("{.fun store_build_metadata}: Force overwriting build metadata for {.pkg {package_name}} {.field {tag}} because {.code force = TRUE} was set.")
|
||||
|
||||
DBI::dbExecute(con, sprintf("UPDATE single_builds SET build_timestamp = '%s', error_occurred = %s, error = '%s' WHERE package_name = '%s' and tag = '%s'", format(Sys.time(), "%Y-%m-%d %H:%M:%S"), error_occurred, error, package_name, tag))
|
||||
DBI::dbExecute(con, "UPDATE single_builds SET build_timestamp = $1, error_occurred = $2, error = $3 WHERE package_name = $4 and tag = $5", params = list(format(Sys.time(), "%Y-%m-%d %H:%M:%S"), error_occurred, error, package_name, tag))
|
||||
} else if (nrow(existing_entries) == 0) {
|
||||
cli::cli_alert("{.fun store_build_metadata}: Storing build metadata for {.pkg {package_name}} {.field {tag}}.")
|
||||
# Create a data frame with the metadata
|
||||
|
|
|
|||
Loading…
Reference in a new issue