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)

Arguments

project

String containing the project name.

asset

String containing the asset name.

staging

String containing the path to the staging directory.

url

String containing the URL of the gobbler REST API.

Value

String containing the latest version of the project, or NULL if there are no non-probational versions.

See also

fetchLatest, to get the latest version without recomputing it.

Author

Aaron Lun

Examples

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"