upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/discovery.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/discovery.rs')
-rw-r--r--src/discovery.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/discovery.rs b/src/discovery.rs
index 430509d..fa2a198 100644
--- a/src/discovery.rs
+++ b/src/discovery.rs
@@ -17,16 +17,13 @@ pub struct DiscoveredRepo {
17pub async fn discover_repos_from_relays( 17pub async fn discover_repos_from_relays(
18 client: &nostr_sdk::Client, 18 client: &nostr_sdk::Client,
19 npubs: &[PublicKey], 19 npubs: &[PublicKey],
20 relay_urls: &[String], 20 index_relays: &[String],
21 all_relay_urls: &[String],
21) -> Result<Vec<DiscoveredRepo>> { 22) -> Result<Vec<DiscoveredRepo>> {
22 for url in relay_urls { 23 for url in all_relay_urls {
23 if let Err(e) = client.add_relay(url).await { 24 let _ = client.add_relay(url).await;
24 tracing::warn!(relay = %url, error = %e, "failed to add relay");
25 continue;
26 }
27 } 25 }
28 client.connect().await; 26 client.connect().await;
29
30 client 27 client
31 .wait_for_connection(std::time::Duration::from_secs(5)) 28 .wait_for_connection(std::time::Duration::from_secs(5))
32 .await; 29 .await;
@@ -40,7 +37,7 @@ pub async fn discover_repos_from_relays(
40 .limit(50); 37 .limit(50);
41 38
42 let events = client 39 let events = client
43 .fetch_events(filter, std::time::Duration::from_secs(30)) 40 .fetch_events_from(index_relays, filter, std::time::Duration::from_secs(30))
44 .await 41 .await
45 .context("failed to fetch events from relays")?; 42 .context("failed to fetch events from relays")?;
46 43