Skip to content

Commit b34aa44

Browse files
committed
Try untar-listing to check if the format is valid
1 parent 063f94f commit b34aa44

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

R/cloud.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,13 @@ cloud_fetch_results <- function(job_name = cloud_job(pkg = pkg), pkg = ".") {
127127
pb2 <- cli_progress_bar(format = "Extracting package results: {pb_percent}", total = sum(to_extract))
128128
for (i in which(to_extract)) {
129129
out_file <- out_files[[i]]
130-
utils::untar(out_file, exdir = out_dir)
130+
files <- suppressWarnings(utils::untar(out_file, exdir = out_dir, list = TRUE))
131+
if (length(files) == 0) {
132+
# Retry downloading next time
133+
unlink(out_file)
134+
} else {
135+
utils::untar(out_file, exdir = out_dir)
136+
}
131137
cli_progress_update(id = pb2)
132138
}
133139
cli_progress_done(id = pb2)

0 commit comments

Comments
 (0)