sdk: label some default queries.

This commit is contained in:
fiatjaf 2024-09-26 21:08:40 -03:00
parent 2c19358c3a
commit ade77ad6c9
3 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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 {

View File

@ -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)
}