sdk: cached zap provider queries.

This commit is contained in:
fiatjaf
2025-10-24 23:10:14 -03:00
parent ea806d2d65
commit 3f1e013912
3 changed files with 75 additions and 0 deletions
+4
View File
@@ -40,6 +40,7 @@ type System struct {
RelaySetsCache cache.Cache32[GenericSets[string, RelayURL]]
FollowSetsCache cache.Cache32[GenericSets[nostr.PubKey, ProfileRef]]
TopicSetsCache cache.Cache32[GenericSets[string, Topic]]
ZapProviderCache cache.Cache32[nostr.PubKey]
Hints hints.HintsDB
Pool *nostr.Pool
RelayListRelays *RelayStream
@@ -131,6 +132,9 @@ func NewSystem() *System {
if sys.RelayListCache == nil {
sys.RelayListCache = cache_memory.New[GenericList[string, Relay]](8000)
}
if sys.ZapProviderCache == nil {
sys.ZapProviderCache = cache_memory.New[nostr.PubKey](8000)
}
if sys.Store == nil {
sys.Store = &nullstore.NullStore{}