mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 16:06:30 +03:00
ffi: remove dc_is_io_running()
It is misleading and should never be checked. dc_stop_io() also stops pending ephemeral message deletion tasks, so it should be called in any case before releasing context.
This commit is contained in:
committed by
link2xt
parent
ebccdbbcb9
commit
8412affe37
@@ -1620,10 +1620,6 @@ pub async fn send_msg_sync(
|
||||
chat_id: ChatId,
|
||||
msg: &mut Message,
|
||||
) -> Result<MsgId, Error> {
|
||||
if context.is_io_running().await {
|
||||
return send_msg(context, chat_id, msg).await;
|
||||
}
|
||||
|
||||
if let Some(mut job) = prepare_send_msg(context, chat_id, msg).await? {
|
||||
let mut smtp = crate::smtp::Smtp::new();
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ impl Context {
|
||||
/// Starts the IO scheduler.
|
||||
pub async fn start_io(&self) {
|
||||
info!(self, "starting IO");
|
||||
if self.is_io_running().await {
|
||||
if self.inner.is_io_running().await {
|
||||
info!(self, "IO is already running");
|
||||
return;
|
||||
}
|
||||
@@ -161,11 +161,6 @@ impl Context {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns if the IO scheduler is running.
|
||||
pub async fn is_io_running(&self) -> bool {
|
||||
self.inner.is_io_running().await
|
||||
}
|
||||
|
||||
/// Stops the IO scheduler.
|
||||
pub async fn stop_io(&self) {
|
||||
info!(self, "stopping IO");
|
||||
|
||||
Reference in New Issue
Block a user