cli: Make sure we sync inventory before announcing

This commit is contained in:
cloudhead 2023-09-03 17:51:22 +02:00
parent 112c940d81
commit 1ab1da1ba1
No known key found for this signature in database
2 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,6 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
let mut doc = doc.verified()?;
if doc.visibility.is_public() {
// TODO: We need to sync inventory too if it's not in the routing table.
return Err(Error::WithHint {
err: anyhow!("repository is already public"),
hint: "to announce the repository to the network, run `rad sync --inventory`",

View File

@ -300,6 +300,7 @@ pub fn announce_inventory(mut node: Node) -> anyhow::Result<()> {
let peers = node.sessions()?.iter().filter(|s| s.is_connected()).count();
let spinner = term::spinner(format!("Announcing inventory to {peers} peers.."));
node.sync_inventory()?;
node.announce_inventory()?;
spinner.finish();