upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/discovery.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/discovery.rs b/src/discovery.rs
index fa2a198..a5d578c 100644
--- a/src/discovery.rs
+++ b/src/discovery.rs
@@ -18,13 +18,14 @@ pub async fn discover_repos_from_relays(
18 client: &nostr_sdk::Client, 18 client: &nostr_sdk::Client,
19 npubs: &[PublicKey], 19 npubs: &[PublicKey],
20 index_relays: &[String], 20 index_relays: &[String],
21 all_relay_urls: &[String], 21 _all_relay_urls: &[String],
22) -> Result<Vec<DiscoveredRepo>> { 22) -> Result<Vec<DiscoveredRepo>> {
23 for url in all_relay_urls { 23 let discovery_client = nostr_sdk::Client::default();
24 let _ = client.add_relay(url).await; 24 for url in index_relays {
25 discovery_client.add_relay(url).await?;
25 } 26 }
26 client.connect().await; 27 discovery_client.connect().await;
27 client 28 discovery_client
28 .wait_for_connection(std::time::Duration::from_secs(5)) 29 .wait_for_connection(std::time::Duration::from_secs(5))
29 .await; 30 .await;
30 31
@@ -36,8 +37,8 @@ pub async fn discover_repos_from_relays(
36 .author(*pk) 37 .author(*pk)
37 .limit(50); 38 .limit(50);
38 39
39 let events = client 40 let events = discovery_client
40 .fetch_events_from(index_relays, filter, std::time::Duration::from_secs(30)) 41 .fetch_events(filter, std::time::Duration::from_secs(30))
41 .await 42 .await
42 .context("failed to fetch events from relays")?; 43 .context("failed to fetch events from relays")?;
43 44