fix: never initialize Iroh if realtime is disabled

This commit is contained in:
link2xt
2024-10-23 17:21:15 +00:00
parent aa3ef5011b
commit 4b3a6445fb
2 changed files with 17 additions and 4 deletions

View File

@@ -1454,8 +1454,13 @@ async fn add_parts(
let relay_server = node_addr.relay_url().map(|relay| relay.as_str());
iroh_add_peer_for_topic(context, instance_id, topic, node_id, relay_server)
.await?;
let iroh = context.get_or_try_init_peer_channel().await?;
iroh.maybe_add_gossip_peers(topic, vec![node_addr]).await?;
if context
.get_config_bool(Config::WebxdcRealtimeEnabled)
.await?
{
let iroh = context.get_or_try_init_peer_channel().await?;
iroh.maybe_add_gossip_peers(topic, vec![node_addr]).await?;
}
} else {
warn!(
context,