mirror of
https://github.com/chatmail/core.git
synced 2026-05-14 20:36:30 +03:00
optimize endpoint
This commit is contained in:
@@ -226,7 +226,16 @@ impl Context {
|
|||||||
|
|
||||||
// Shuts down on deltachat shutdown
|
// Shuts down on deltachat shutdown
|
||||||
tokio::spawn(endpoint_loop(context, endpoint.clone(), gossip.clone()));
|
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 {
|
Ok(Iroh {
|
||||||
endpoint,
|
endpoint,
|
||||||
gossip,
|
gossip,
|
||||||
|
|||||||
Reference in New Issue
Block a user