feat: 💨

This commit is contained in:
codytseng 2025-01-14 12:44:22 +08:00
parent a3c6cf0c21
commit 3f031da748
3 changed files with 12 additions and 14 deletions

View file

@ -48,11 +48,11 @@ class ClientService extends EventTarget {
private profileEventCache = new LRUCache<string, Promise<NEvent | undefined>>({ max: 10000 })
private profileEventDataloader = new DataLoader<string, NEvent | undefined>(
(ids) => Promise.all(ids.map((id) => this._fetchProfileEvent(id))),
{ cacheMap: this.profileEventCache }
{ cacheMap: this.profileEventCache, maxBatchSize: 10 }
)
private fetchProfileEventFromDefaultRelaysDataloader = new DataLoader<string, NEvent | undefined>(
this.profileEventBatchLoadFn.bind(this),
{ cache: false }
{ cache: false, maxBatchSize: 10 }
)
private relayListEventDataLoader = new DataLoader<string, NEvent | undefined>(
this.relayListEventBatchLoadFn.bind(this),