mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-17 21:32:56 +01:00
sdk: label some default queries.
This commit is contained in:
parent
2c19358c3a
commit
ade77ad6c9
@ -128,7 +128,7 @@ func (sys *System) FetchUserEvents(ctx context.Context, filter nostr.Filter) (ma
|
||||
go func(relayURL string, filter nostr.Filter) {
|
||||
defer wg.Done()
|
||||
filter.Limit = filter.Limit * len(filter.Authors) // hack
|
||||
for ie := range sys.Pool.SubManyEose(ctx, []string{relayURL}, nostr.Filters{filter}) {
|
||||
for ie := range sys.Pool.SubManyEose(ctx, []string{relayURL}, nostr.Filters{filter}, nostr.WithLabel("userevts")) {
|
||||
results[ie.PubKey] = append(results[ie.PubKey], ie.Event)
|
||||
}
|
||||
}(relayURL, filter)
|
||||
|
@ -170,7 +170,7 @@ func (sys *System) batchReplaceableRelayQueries(
|
||||
defer cancel()
|
||||
|
||||
received := 0
|
||||
for ie := range sys.Pool.SubManyEose(ctx, []string{url}, nostr.Filters{filter}) {
|
||||
for ie := range sys.Pool.SubManyEose(ctx, []string{url}, nostr.Filters{filter}, nostr.WithLabel("repl")) {
|
||||
all <- ie.Event
|
||||
received++
|
||||
if received >= n {
|
||||
|
@ -15,7 +15,7 @@ func (sys *System) SearchUsers(ctx context.Context, query string) []ProfileMetad
|
||||
Search: query,
|
||||
Limit: limit,
|
||||
},
|
||||
}) {
|
||||
}, nostr.WithLabel("search")) {
|
||||
m, _ := ParseMetadata(ie.Event)
|
||||
profiles = append(profiles, m)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user