Zap splits

This commit is contained in:
2023-09-14 12:31:17 +01:00
parent 4864ef6831
commit d2baf9bd5b
28 changed files with 907 additions and 562 deletions

View File

@ -64,6 +64,25 @@ export class ProfileLoaderService {
}
}
async fetchProfile(key: string) {
const existing = this.Cache.get(key);
if (existing) {
return existing;
} else {
return await new Promise<MetadataCache>((resolve, reject) => {
this.TrackMetadata(key);
const release = this.Cache.hook(() => {
const existing = this.Cache.getFromCache(key);
if (existing) {
resolve(existing);
release();
this.UntrackMetadata(key);
}
}, key);
});
}
}
async #FetchMetadata() {
const missingFromCache = await this.#cache.buffer([...this.#wantsMetadata]);