mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 06:14:22 +01:00
label our submany queries.
This commit is contained in:
22
nostr.go
22
nostr.go
@@ -158,7 +158,12 @@ func getEvent(ctx context.Context, code string) (*nostr.Event, []string, error)
|
||||
|
||||
fetchProfileOnce := sync.Once{}
|
||||
|
||||
for ie := range sys.Pool.SubManyEoseNonUnique(subManyCtx, relays, nostr.Filters{filter}) {
|
||||
for ie := range sys.Pool.SubManyEoseNonUnique(
|
||||
subManyCtx,
|
||||
relays,
|
||||
nostr.Filters{filter},
|
||||
nostr.WithLabel("fetching "+prefix),
|
||||
) {
|
||||
fetchProfileOnce.Do(func() {
|
||||
go sys.FetchProfileMetadata(ctx, ie.PubKey)
|
||||
})
|
||||
@@ -240,7 +245,7 @@ func authorLastNotes(ctx context.Context, pubkey string, isSitemap bool) []Enhan
|
||||
relays = unique(append(relays, getRandomRelay()))
|
||||
}
|
||||
|
||||
ch := sys.Pool.SubManyEose(ctx, relays, nostr.Filters{filter})
|
||||
ch := sys.Pool.SubManyEose(ctx, relays, nostr.Filters{filter}, nostr.WithLabel("authorlast"))
|
||||
out:
|
||||
for {
|
||||
select {
|
||||
@@ -312,13 +317,12 @@ func contactsForPubkey(ctx context.Context, pubkey string) []string {
|
||||
relays = append(relays, pubkeyRelays...)
|
||||
relays = append(relays, sys.MetadataRelays...)
|
||||
|
||||
ch := sys.Pool.SubManyEose(ctx, relays, nostr.Filters{
|
||||
{
|
||||
Kinds: []int{3},
|
||||
Authors: []string{pubkey},
|
||||
Limit: 2,
|
||||
},
|
||||
})
|
||||
ch := sys.Pool.SubManyEose(
|
||||
ctx,
|
||||
relays,
|
||||
nostr.Filters{{Kinds: []int{3}, Authors: []string{pubkey}, Limit: 2}},
|
||||
nostr.WithLabel("contacts"),
|
||||
)
|
||||
|
||||
for {
|
||||
select {
|
||||
|
||||
@@ -25,7 +25,6 @@ type OpengraphFields struct {
|
||||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
initCache()
|
||||
code := m.Run()
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user