* Remove expired items from the cache
()
| 101 | * Remove expired items from the cache |
| 102 | */ |
| 103 | async sweep() { |
| 104 | debug('Sweeping cache...'); |
| 105 | for (const key of this.store.keys()) { |
| 106 | if (await this.isExpired(key)) { |
| 107 | debug('Cache for %s is swept.', key); |
| 108 | await this.delete(key); |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * This method will be invoked when the application starts |