Increase cache clean-up interval

50340103dea13e19a42ba6d3a11a0431b0a7d226

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -1Ignore whitespace
src/endpoints/characters.js+4 -1
@@ -43,7 +43,7 @@ class DiskCache {
43 static DIRECTORY = 'characters';43 static DIRECTORY = 'characters';
4444
45 /** @type {number} */45 /** @type {number} */
46 static REMOVAL_INTERVAL = 60 * 1000;46 static REMOVAL_INTERVAL = 5 * 60 * 1000;
4747
48 /** @type {import('node-persist').LocalStorage} */48 /** @type {import('node-persist').LocalStorage} */
49 #instance;49 #instance;
@@ -78,6 +78,9 @@ class DiskCache {
78 * @returns {Promise<void>}78 * @returns {Promise<void>}
79 */79 */
80 async #removeCacheEntries() {80 async #removeCacheEntries() {
81 // TODO: consider running this.verify() for a user instead as getting all cache keys
82 // is a heavy operation, since it requires to read all files in the disk cache.
83
81 try {84 try {
82 if (!useDiskCache || this.removalQueue.length === 0) {85 if (!useDiskCache || this.removalQueue.length === 0) {
83 return;86 return;