(force)
| 363 | } |
| 364 | |
| 365 | rotate(force) { |
| 366 | if (force == null) force = false; |
| 367 | Utils.nextTick(() => { |
| 368 | if ( |
| 369 | force || (this.maxEntries < Object.keys(this.cache).length) || |
| 370 | (this.expiry < (new Date() - this.lastRotation)) |
| 371 | ) { |
| 372 | this.lastRotation = new Date(); |
| 373 | this.previous = this.cache; |
| 374 | return this.cache = {}; |
| 375 | } |
| 376 | }); |
| 377 | } |
| 378 | |
| 379 | clear() { |
| 380 | this.rotate(true); |