Skip to content

Commit

Permalink
Delete existing dirs on each run in order to keep only newly indexed …
Browse files Browse the repository at this point in the history
…files and remove previously indexed files
  • Loading branch information
pranavanba committed Apr 9, 2024
1 parent 4ccd95c commit 100b0a8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sts_synindex_internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ junk <- invisible(lapply(list.dirs(AWS_PARQUET_DOWNLOAD_LOCATION), replace_equal

# Generate manifest of existing files -------------------------------------

existing_dirs <- synapser::synGetChildren(PARQUET_FOLDER) %>% synapser::as.list()

if(length(existing_dirs)>0) {
for (i in seq_along(existing_dirs)) {
synapser::synDelete(existing_dirs[[i]]$id)
}
}

SYNAPSE_AUTH_TOKEN <- Sys.getenv('SYNAPSE_AUTH_TOKEN')
manifest_cmd <- glue::glue('SYNAPSE_AUTH_TOKEN="{SYNAPSE_AUTH_TOKEN}" synapse manifest --parent-id {SYNAPSE_PARENT_ID} --manifest ./current_manifest.tsv {AWS_PARQUET_DOWNLOAD_LOCATION}')
system(manifest_cmd)
Expand Down

0 comments on commit 100b0a8

Please sign in to comment.