mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 10:56:29 +03:00
optimize endpoint
This commit is contained in:
@@ -226,7 +226,16 @@ impl Context {
|
||||
|
||||
// Shuts down on deltachat shutdown
|
||||
tokio::spawn(endpoint_loop(context, endpoint.clone(), gossip.clone()));
|
||||
|
||||
let endp = endpoint.clone();
|
||||
let gsp = gossip.clone();
|
||||
tokio::spawn(async move {
|
||||
let mut stream = endp.local_endpoints();
|
||||
while let Some(endpoints) = stream.next().await {
|
||||
gsp.update_endpoints(&endpoints)?;
|
||||
}
|
||||
anyhow::Ok(())
|
||||
})
|
||||
.await??;
|
||||
Ok(Iroh {
|
||||
endpoint,
|
||||
gossip,
|
||||
|
||||
Reference in New Issue
Block a user