Function for clearing the register cache
Source:R/utils_preprocess_register.R
register_clear_cache.RdRemoves everything cached below the R.cache root: the codecheck.yml files, the codecheckers table, and the looked up OpenAlex IDs and abstracts. Use it to pick up metadata that has changed at the source, the lookups themselves never cache a failed request.
Value
0 for success, 1 for failure, invisibly (see `unlink`); with `certificates`, invisibly the number of cache entries removed
Details
With `certificates`, only what is cached about those certificates is refreshed, and the rest of the cache - which takes minutes of API requests to rebuild - is kept: the certificate's `codecheck.yml` is fetched again, and its abstract, OpenAlex ID, certificate PDF link, report platform and Zenodo or ResearchEquals policy record are removed, so the next render or check looks them up anew. Entries shared with other certificates, such as a person's ORCID affiliations, are kept.