MCPcopy Index your code
hub / github.com/protomaps/PMTiles / invalidate

Method invalidate

js/src/index.ts:839–856  ·  view source on GitHub ↗
(source: Source)

Source from the content-addressed store, hash-verified

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/**

Callers

nothing calls this directly

Calls 3

getHeaderMethod · 0.95
getKeyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected