mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 06:16:30 +03:00
optimize logs
This commit is contained in:
@@ -158,10 +158,6 @@ impl Iroh {
|
|||||||
|
|
||||||
self.gossip.broadcast(topic, data.into()).await?;
|
self.gossip.broadcast(topic, data.into()).await?;
|
||||||
|
|
||||||
if env::var("REALTIME_DEBUG").is_ok() {
|
|
||||||
info!(ctx, "Sent realtime data");
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -357,7 +353,9 @@ pub async fn send_webxdc_realtime_advertisement(
|
|||||||
msg.param.set_cmd(SystemMessage::IrohNodeAddr);
|
msg.param.set_cmd(SystemMessage::IrohNodeAddr);
|
||||||
msg.in_reply_to = Some(webxdc.rfc724_mid.clone());
|
msg.in_reply_to = Some(webxdc.rfc724_mid.clone());
|
||||||
send_msg(ctx, webxdc.chat_id, &mut msg).await?;
|
send_msg(ctx, webxdc.chat_id, &mut msg).await?;
|
||||||
info!(ctx, "IROH_REALTIME: Sent realtime advertisement");
|
if env::var("REALTIME_DEBUG").is_ok() {
|
||||||
|
info!(ctx, "IROH_REALTIME: Sent realtime advertisement");
|
||||||
|
}
|
||||||
Ok(conn)
|
Ok(conn)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -373,6 +371,7 @@ pub async fn leave_webxdc_realtime(ctx: &Context, msg_id: MsgId) -> Result<()> {
|
|||||||
let iroh = ctx.get_or_try_init_peer_channel().await?;
|
let iroh = ctx.get_or_try_init_peer_channel().await?;
|
||||||
iroh.leave_realtime(get_iroh_topic_for_msg(ctx, msg_id).await?)
|
iroh.leave_realtime(get_iroh_topic_for_msg(ctx, msg_id).await?)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
info!(ctx, "IROH_REALTIME: Left gossip for message {msg_id}");
|
info!(ctx, "IROH_REALTIME: Left gossip for message {msg_id}");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -440,11 +439,12 @@ async fn subscribe_loop(
|
|||||||
let event = stream.recv().await?;
|
let event = stream.recv().await?;
|
||||||
match event {
|
match event {
|
||||||
IrohEvent::NeighborUp(node) => {
|
IrohEvent::NeighborUp(node) => {
|
||||||
info!(context, "IROH_REALTIME: NeighborUp: {}", node.to_string());
|
|
||||||
iroh_add_peer_for_topic(context, msg_id, topic, node, None).await?;
|
iroh_add_peer_for_topic(context, msg_id, topic, node, None).await?;
|
||||||
}
|
}
|
||||||
IrohEvent::Received(event) => {
|
IrohEvent::Received(event) => {
|
||||||
info!(context, "IROH_REALTIME: Received realtime data");
|
if env::var("REALTIME_DEBUG").is_ok() {
|
||||||
|
info!(context, "IROH_REALTIME: Received realtime data");
|
||||||
|
}
|
||||||
context.emit_event(EventType::WebxdcRealtimeData {
|
context.emit_event(EventType::WebxdcRealtimeData {
|
||||||
msg_id,
|
msg_id,
|
||||||
data: event
|
data: event
|
||||||
|
|||||||
Reference in New Issue
Block a user