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{}
|
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() {
|
fetchProfileOnce.Do(func() {
|
||||||
go sys.FetchProfileMetadata(ctx, ie.PubKey)
|
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()))
|
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:
|
out:
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
@@ -312,13 +317,12 @@ func contactsForPubkey(ctx context.Context, pubkey string) []string {
|
|||||||
relays = append(relays, pubkeyRelays...)
|
relays = append(relays, pubkeyRelays...)
|
||||||
relays = append(relays, sys.MetadataRelays...)
|
relays = append(relays, sys.MetadataRelays...)
|
||||||
|
|
||||||
ch := sys.Pool.SubManyEose(ctx, relays, nostr.Filters{
|
ch := sys.Pool.SubManyEose(
|
||||||
{
|
ctx,
|
||||||
Kinds: []int{3},
|
relays,
|
||||||
Authors: []string{pubkey},
|
nostr.Filters{{Kinds: []int{3}, Authors: []string{pubkey}, Limit: 2}},
|
||||||
Limit: 2,
|
nostr.WithLabel("contacts"),
|
||||||
},
|
)
|
||||||
})
|
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ type OpengraphFields struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
initCache()
|
|
||||||
code := m.Run()
|
code := m.Run()
|
||||||
os.Exit(code)
|
os.Exit(code)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user