use our own dataloader and simplify batch replaceable requests, removing bugs.

This commit is contained in:
fiatjaf
2025-03-20 19:37:37 -03:00
parent 25838a024e
commit 78dbf9def5
11 changed files with 321 additions and 173 deletions

View File

@ -74,7 +74,7 @@ func fetchGenericList[I TagItemWithValue](
v = *newV
}
// even if we didn't find anything register this because we tried
// register this even if we didn't find anything because we tried
// (and we still have the previous event in our local store)
sys.KVStore.Set(lastFetchKey, encodeTimestamp(nostr.Now()))
}
@ -108,8 +108,7 @@ func tryFetchListFromNetwork[I TagItemWithValue](
replaceableIndex replaceableIndex,
parseTag func(nostr.Tag) (I, bool),
) *GenericList[I] {
thunk := sys.replaceableLoaders[replaceableIndex].Load(ctx, pubkey)
evt, err := thunk()
evt, err := sys.replaceableLoaders[replaceableIndex].Load(ctx, pubkey)
if err != nil {
return nil
}