Clean up cache module; affects [feedz jenkinsplugin myget node nuget packagist travis wordpress] (#7319)

* update terminology
    - "regular update" to "cached resource"
    - "interval" to "ttl"
    - move file and update imports

* set a default TTL, don't explicitly pass params if we want the default

* add tests

* update docs
This commit is contained in:
chris48s
2021-11-29 21:21:03 +00:00
committed by GitHub
parent 8355793520
commit feb1682814
10 changed files with 82 additions and 40 deletions

View File

@@ -49,11 +49,11 @@ Shields has mercifully little persistent state:
1. The GitHub tokens we collect are saved on each server in a cloud Redis
database. They can also be fetched from the [GitHub auth admin endpoint][]
for debugging.
2. The server keeps the [regular-update cache][] in memory. It is neither
2. The server keeps the [resource cache][] in memory. It is neither
persisted nor inspectable.
[github auth admin endpoint]: https://github.com/badges/shields/blob/master/services/github/auth/admin.js
[regular-update cache]: https://github.com/badges/shields/blob/master/core/legacy/regular-update.js
[resource cache]: https://github.com/badges/shields/blob/master/core/base-service/resource-cache.js
## Configuration