diff options
| author | Your Name <you@example.com> | 2026-05-27 17:24:19 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-27 17:24:19 +0530 |
| commit | 319f44139bc668a4fa59d4c4361f442b3f87b95c (patch) | |
| tree | 38ce65c279f9aeb945a47e60e4af434d5adb3488 /src/discovery.rs | |
| parent | 9869113e1eb4ba76b6b85e09c72d6ec83620d8ae (diff) | |
Fix discovery: wait for relay connections, add per-npub logging, suppress relay pool spam
Diffstat (limited to 'src/discovery.rs')
| -rw-r--r-- | src/discovery.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/discovery.rs b/src/discovery.rs index 59b9f2c..430509d 100644 --- a/src/discovery.rs +++ b/src/discovery.rs | |||
| @@ -27,6 +27,10 @@ pub async fn discover_repos_from_relays( | |||
| 27 | } | 27 | } |
| 28 | client.connect().await; | 28 | client.connect().await; |
| 29 | 29 | ||
| 30 | client | ||
| 31 | .wait_for_connection(std::time::Duration::from_secs(5)) | ||
| 32 | .await; | ||
| 33 | |||
| 30 | let mut repos = Vec::new(); | 34 | let mut repos = Vec::new(); |
| 31 | 35 | ||
| 32 | for pk in npubs { | 36 | for pk in npubs { |
| @@ -40,6 +44,12 @@ pub async fn discover_repos_from_relays( | |||
| 40 | .await | 44 | .await |
| 41 | .context("failed to fetch events from relays")?; | 45 | .context("failed to fetch events from relays")?; |
| 42 | 46 | ||
| 47 | tracing::info!( | ||
| 48 | npub = %pk.to_hex(), | ||
| 49 | count = events.len(), | ||
| 50 | "fetched kind:30617 events" | ||
| 51 | ); | ||
| 52 | |||
| 43 | for event in events.into_iter() { | 53 | for event in events.into_iter() { |
| 44 | if let Some(repo) = parse_announcement(&event) { | 54 | if let Some(repo) = parse_announcement(&event) { |
| 45 | repos.push(repo); | 55 | repos.push(repo); |