mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2026-04-06 12:03:16 +08:00
feat (restful): Add /api/utils/refresh
The API call does the following: - Fetch GitHub avatar and update artifact store url - Revoke all cached resources
This commit is contained in:
@@ -25,6 +25,14 @@ class ResourceCache {
|
||||
if (clear) this._persist();
|
||||
}
|
||||
|
||||
revokeAll() {
|
||||
Object.keys(this.resourceCache).forEach((id) => {
|
||||
$.delete(`#${id}`);
|
||||
});
|
||||
this.resourceCache = {};
|
||||
this._persist();
|
||||
}
|
||||
|
||||
_persist() {
|
||||
$.write(JSON.stringify(this.resourceCache), RESOURCE_CACHE_KEY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user