Recompute the latest version of a project's asset. This is useful on rare occasions where multiple simultaneous uploads cause the latest version to be slightly out of sync.
refreshLatest(project, asset, staging, url)
String containing the latest version of the project, or NULL
if there are no non-probational versions.
fetchLatest
, to get the latest version without recomputing it.
info <- startGobbler()
removeProject("test", info$staging, url=info$url) # start from a clean slate.
createProject("test", info$staging, url=info$url)
# Mocking up a few uploads.
src <- allocateUploadDirectory(info$staging)
for (v in c("v1", "v2")) {
uploadDirectory("test", "simple", v, src, staging=info$staging, url=info$url)
}
# Delete the ..latest file.
unlink(file.path(info$registry, "test", "simple", "..latest"))
fetchLatest("test", "simple", registry=info$registry)
#> NULL
# Recomputing it:
refreshLatest("test", "simple", info$staging, url=info$url)
fetchLatest("test", "simple", registry=info$registry)
#> [1] "v1"