mirror of
https://github.com/aljazceru/crawler_v2.git
synced 2025-12-17 07:24:21 +01:00
exporting ParsePubkeys
This commit is contained in:
@@ -194,7 +194,7 @@ func computeDelta(ctx context.Context, db redb.RedisDB, cache *walks.CachedWalke
|
|||||||
return graph.Delta{}, fmt.Errorf("failed to compute delta: %w", err)
|
return graph.Delta{}, fmt.Errorf("failed to compute delta: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
pubkeys := parsePubkeys(event)
|
pubkeys := ParsePubkeys(event)
|
||||||
onMissing := redb.Ignore
|
onMissing := redb.Ignore
|
||||||
if author.Status == graph.StatusActive {
|
if author.Status == graph.StatusActive {
|
||||||
// active nodes are the only ones that can add new pubkeys to the database
|
// active nodes are the only ones that can add new pubkeys to the database
|
||||||
@@ -239,8 +239,8 @@ const (
|
|||||||
maxFollows = 50000
|
maxFollows = 50000
|
||||||
)
|
)
|
||||||
|
|
||||||
// parse unique pubkeys (excluding author) from the "p" tags in the event.
|
// Parse unique pubkeys (excluding author) from the "p" tags in the event.
|
||||||
func parsePubkeys(event *nostr.Event) []string {
|
func ParsePubkeys(event *nostr.Event) []string {
|
||||||
pubkeys := make([]string, 0, min(len(event.Tags), maxFollows))
|
pubkeys := make([]string, 0, min(len(event.Tags), maxFollows))
|
||||||
for _, tag := range event.Tags {
|
for _, tag := range event.Tags {
|
||||||
if len(pubkeys) > maxFollows {
|
if len(pubkeys) > maxFollows {
|
||||||
|
|||||||
Reference in New Issue
Block a user