sdk: fix default Publisher to work with any store.

This commit is contained in:
fiatjaf
2026-02-22 18:02:22 -03:00
parent 7aa127a8c3
commit 32dd39da81
2 changed files with 42 additions and 2 deletions
+2 -2
View File
@@ -72,7 +72,7 @@ type System struct {
NoteSearchRelays *RelayStream
Store eventstore.Store
Publisher wrappers.StorePublisher
Publisher nostr.Publisher
replaceableLoaders []*dataloader.Loader[nostr.PubKey, nostr.Event]
addressableLoaders []*dataloader.Loader[nostr.PubKey, []nostr.Event]
@@ -178,7 +178,7 @@ func NewSystem() *System {
sys.Store = &nullstore.NullStore{}
sys.Store.Init()
}
sys.Publisher = wrappers.StorePublisher{Store: sys.Store, MaxLimit: 1000}
sys.Publisher = wrappers.DynamicPublisher{GetStore: func() eventstore.Store { return sys.Store }, MaxLimit: 1000}
sys.initializeReplaceableDataloaders()
sys.initializeAddressableDataloaders()