Increase cache clean-up interval
| @@ -43,7 +43,7 @@ class DiskCache { | |||
| 43 | static DIRECTORY = 'characters'; | 43 | static DIRECTORY = 'characters'; |
| 44 | 44 | ||
| 45 | /** @type {number} */ | 45 | /** @type {number} */ |
| 46 | static REMOVAL_INTERVAL = 60 * 1000; | 46 | static REMOVAL_INTERVAL = 5 * 60 * 1000; |
| 47 | 47 | ||
| 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; |