mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-11-28 23:40:30 +00: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:
1 parent
6881148021
commit
2c4e47166d
8 files changed
+37
-14
No files matched your search
@@ -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