add file size to metadata
This commit is contained in:
parent
8c092af8b9
commit
17b8d44c7b
1 changed files with 7 additions and 2 deletions
|
|
@ -188,6 +188,9 @@ build_single_tag <- function(
|
|||
|
||||
total_build_time <- round(difftime(Sys.time(), t1, units = "secs"), 2)
|
||||
|
||||
# bytes to MB in binary format
|
||||
file_size <- as.numeric(fs::file_size(sprintf("%s/%s_%s.tar.gz", dir_out_bin, package_name, tag))) / (1024^2)
|
||||
|
||||
# skip DB connection if package already exists
|
||||
if (file.exists(sprintf("%s/%s_%s.tar.gz", dir_out_bin, package_name, tag))) {
|
||||
con <- DBI::dbConnect(RPostgres::Postgres(),
|
||||
|
|
@ -195,8 +198,10 @@ build_single_tag <- function(
|
|||
port = 15432, user = "arm_binaries", password = Sys.getenv("PGPASS")
|
||||
)
|
||||
dbExecute(con, sprintf(
|
||||
"UPDATE single_builds set build_duration = %s WHERE package_name = '%s' and platform = '%s' and tag = '%s'",
|
||||
total_build_time, package_name, platform, tag
|
||||
"UPDATE single_builds SET build_duration = $1, size = $2 WHERE package_name = $3 and platform = $4 and tag = $5",
|
||||
params = list(
|
||||
total_build_time, file_size, package_name, platform, tag
|
||||
)
|
||||
))
|
||||
dbDisconnect(con)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue