(source: Source)
| 837 | } |
| 838 | |
| 839 | async invalidate(source: Source) { |
| 840 | const key = source.getKey(); |
| 841 | if (this.invalidations.get(key)) { |
| 842 | return await this.invalidations.get(key); |
| 843 | } |
| 844 | this.cache.delete(source.getKey()); |
| 845 | const p = new Promise<void>((resolve, reject) => { |
| 846 | this.getHeader(source) |
| 847 | .then((h) => { |
| 848 | resolve(); |
| 849 | this.invalidations.delete(key); |
| 850 | }) |
| 851 | .catch((e) => { |
| 852 | reject(e); |
| 853 | }); |
| 854 | }); |
| 855 | this.invalidations.set(key, p); |
| 856 | } |
| 857 | } |
| 858 | |
| 859 | /** |