Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Commit

Permalink
fix: announcements not reliable on seed
Browse files Browse the repository at this point in the history
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
  • Loading branch information
rudolfs committed Jan 11, 2022
1 parent 7b219cb commit 1b3b8ba
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions upstream-seed/src/peer.rs
Expand Up @@ -257,8 +257,9 @@ impl Peer {
.storage()
.await
.context("failed to access librad storage")?;
let projects =
rad_identities::project::list(storage.as_ref()).context("failed to list projects")?;
let projects = rad_identities::project::list(storage.as_ref())
.context("failed to list projects")?
.collect::<Vec<_>>();
for project_result in projects {
let project = match project_result {
Ok(project) => project,
Expand Down Expand Up @@ -286,8 +287,13 @@ impl Peer {
};
tracing::debug!(%urn, %origin, "sending announcement");
self.librad_peer
.announce(payload)
.announce(payload.clone())
.map_err(|_| anyhow::anyhow!("librad peer not bound"))?;

// If we don't sleep librad might be overwhelmed by too many announcements and not
// send some of them out.
// https://github.com/radicle-dev/radicle-upstream/issues/2713
tokio::time::sleep(std::time::Duration::from_millis(2)).await;
}
}

Expand Down

0 comments on commit 1b3b8ba

Please sign in to comment.