mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +03:00
stop more times in repl tool
This commit is contained in:
@@ -603,8 +603,11 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
|
|||||||
ensure!(sel_chat.is_some(), "Failed to select chat");
|
ensure!(sel_chat.is_some(), "Failed to select chat");
|
||||||
let sel_chat = sel_chat.as_ref().unwrap();
|
let sel_chat = sel_chat.as_ref().unwrap();
|
||||||
|
|
||||||
|
let time_start = std::time::SystemTime::now();
|
||||||
let msglist =
|
let msglist =
|
||||||
chat::get_chat_msgs(&context, sel_chat.get_id(), DC_GCM_ADDDAYMARKER, None).await?;
|
chat::get_chat_msgs(&context, sel_chat.get_id(), DC_GCM_ADDDAYMARKER, None).await?;
|
||||||
|
let time_needed = time_start.elapsed().unwrap_or_default();
|
||||||
|
|
||||||
let msglist: Vec<MsgId> = msglist
|
let msglist: Vec<MsgId> = msglist
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|x| match x {
|
.map(|x| match x {
|
||||||
@@ -659,7 +662,15 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
|
|||||||
"{} messages.",
|
"{} messages.",
|
||||||
sel_chat.get_id().get_msg_cnt(&context).await?
|
sel_chat.get_id().get_msg_cnt(&context).await?
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let time_noticed_start = std::time::SystemTime::now();
|
||||||
chat::marknoticed_chat(&context, sel_chat.get_id()).await?;
|
chat::marknoticed_chat(&context, sel_chat.get_id()).await?;
|
||||||
|
let time_noticed_needed = time_noticed_start.elapsed().unwrap_or_default();
|
||||||
|
|
||||||
|
println!(
|
||||||
|
"{:?} to create this list, {:?} to mark all messages as noticed.",
|
||||||
|
time_needed, time_noticed_needed
|
||||||
|
);
|
||||||
}
|
}
|
||||||
"createchat" => {
|
"createchat" => {
|
||||||
ensure!(!arg1.is_empty(), "Argument <contact-id> missing.");
|
ensure!(!arg1.is_empty(), "Argument <contact-id> missing.");
|
||||||
|
|||||||
Reference in New Issue
Block a user