Fix tokio panic

This might not be needed after all because of
https://github.com/tokio-rs/tokio/pull/5710, but since I already wrote
the code, I created a PR anyway.
This commit is contained in:
Hocuri
2023-05-23 10:38:19 +02:00
parent 5b435d11c7
commit ebfe917ed2
16 changed files with 65 additions and 29 deletions

View File

@@ -6,6 +6,7 @@ use anyhow::{anyhow, bail, ensure, Context, Result};
pub use deltachat::accounts::Accounts;
use deltachat::message::get_msg_read_receipts;
use deltachat::qr::Qr;
use deltachat::tools;
use deltachat::{
chat::{
self, add_contact_to_chat, forward_msgs, get_chat_media, get_chat_msgs, get_chat_msgs_ex,
@@ -152,7 +153,7 @@ impl CommandApi {
impl CommandApi {
/// Test function.
async fn sleep(&self, delay: f64) {
tokio::time::sleep(std::time::Duration::from_secs_f64(delay)).await
tools::sleep(std::time::Duration::from_secs_f64(delay)).await
}
// ---------------------------------------------