* This method will be invoked when the application starts
()
| 114 | * This method will be invoked when the application starts |
| 115 | */ |
| 116 | async start(): Promise<void> { |
| 117 | debug('Starting caching service'); |
| 118 | await this.clear(); |
| 119 | const ttl = await this.getTTL(); |
| 120 | debug('TTL: %d', ttl); |
| 121 | this.timer = setInterval(() => { |
| 122 | this.sweep().catch(console.warn); |
| 123 | }, ttl); |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * This method will be invoked when the application stops |