Skip to contents

Sets the download status to ready for a cache item

Usage

omnipath_cache_download_ready(version, key = NULL)

Arguments

version

Version of the cache item. If does not exist a new version item will be created

key

Key of the cache item

Value

Character: invisibly returns the version number of the cache version item.

Examples

bioc_url <- 'https://bioconductor.org/'
# request a new version item (or retrieve the latest)
new_version <- omnipath_cache_latest_or_new(url = bioc_url)
# check if the version item is not a finished download
new_version$status
#> [1] "unknown"
# [1] "unknown"
# download the file
httr::GET(bioc_url, httr::write_disk(new_version$path, overwrite = TRUE))
#> Response [https://bioconductor.org/]
#>   Date: 2024-04-07 15:20
#>   Status: 200
#>   Content-Type: text/html
#>   Size: 37.3 kB
#> <ON DISK>  /home/denes/.cache/OmnipathR/41346a00fb20d2a9df03aa70cf4d50bf88ab154a-1
# report to the cache database that the download is ready
omnipath_cache_download_ready(new_version)
# now the status is ready:
version <- omnipath_cache_latest_or_new(url = bioc_url)
version$status
#> [1] "ready"
# "ready"
version$dl_finished
#> [1] "2024-04-07 17:30:27 CEST"
# [1] "2021-03-09 16:48:38 CET"
omnipath_cache_remove(url = bioc_url) # cleaning up