Skip to content

Commit e6d0065

Browse files
committed
Try untar-listing to check if the format is valid
1 parent b855323 commit e6d0065

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
@@ -150,7 +150,13 @@ cloud_fetch_results <- function(job_name = cloud_job(pkg = pkg), pkg = ".") {
150150
pb2 <- cli_progress_bar(format = "Extracting package results: {pb_percent}", total = sum(to_extract))
151151
for (i in which(to_extract)) {
152152
out_file <- out_files[[i]]
153-
utils::untar(out_file, exdir = out_dir)
153+
files <- suppressWarnings(utils::untar(out_file, exdir = out_dir, list = TRUE))
154+
if (length(files) == 0) {
155+
# Retry downloading next time
156+
unlink(out_file)
157+
} else {
158+
utils::untar(out_file, exdir = out_dir)
159+
}
154160
cli_progress_update(id = pb2)
155161
}
156162
cli_progress_done(id = pb2)

0 commit comments

Comments
 (0)