name spawned tasks in core

This commit is contained in:
Simon Laux
2024-10-03 09:46:05 +02:00
parent f37fb9574d
commit 308053dc44
13 changed files with 78 additions and 57 deletions

View File

@@ -24,7 +24,6 @@ use rand::Rng;
use ratelimit::Ratelimit;
use url::Url;
use crate::chat::{self, ChatId, ChatIdBlocked};
use crate::chatlist_events;
use crate::config::Config;
use crate::constants::{self, Blocked, Chattype, ShowEmails};
@@ -48,6 +47,10 @@ use crate::scheduler::connectivity::ConnectivityStore;
use crate::sql;
use crate::stock_str;
use crate::tools::{self, create_id, duration_to_str};
use crate::{
chat::{self, ChatId, ChatIdBlocked},
spawn_named_task,
};
pub(crate) mod capabilities;
mod client;
@@ -1556,7 +1559,9 @@ impl Session {
} else if !context.push_subscriber.heartbeat_subscribed().await {
let context = context.clone();
// Subscribe for heartbeat notifications.
tokio::spawn(async move { context.push_subscriber.subscribe(&context).await });
spawn_named_task!("subscribe_to_heartbeat_notifications", async move {
context.push_subscriber.subscribe(&context).await
});
}
Ok(())