mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
log chatlist build time
This commit is contained in:
@@ -15,7 +15,7 @@ use crate::message::{Message, MessageState, MsgId};
|
||||
use crate::param::{Param, Params};
|
||||
use crate::stock_str;
|
||||
use crate::summary::Summary;
|
||||
use crate::tools::IsNoneOrEmpty;
|
||||
use crate::tools::{IsNoneOrEmpty, Time, time_elapsed};
|
||||
|
||||
/// Regex to find out if a query should filter by unread messages.
|
||||
pub static IS_UNREAD_FILTER: LazyLock<regex::Regex> =
|
||||
@@ -264,7 +264,8 @@ impl Chatlist {
|
||||
).await?
|
||||
} else {
|
||||
// show normal chatlist
|
||||
context.sql.query_map_vec(
|
||||
let start = Time::now();
|
||||
let items = context.sql.query_map_vec(
|
||||
"SELECT c.id, m.id
|
||||
FROM chats c
|
||||
LEFT JOIN msgs m
|
||||
@@ -286,7 +287,13 @@ impl Chatlist {
|
||||
ORDER BY c.id=0 DESC, c.archived=? DESC, IFNULL(NULLIF(m.timestamp,0),c.created_timestamp) DESC, m.id DESC;",
|
||||
(skip_id, ChatVisibility::Archived, ChatVisibility::Pinned),
|
||||
process_row,
|
||||
).await?
|
||||
).await?;
|
||||
info!(
|
||||
context,
|
||||
"chatlist built in {:?}.",
|
||||
time_elapsed(&start),
|
||||
);
|
||||
items
|
||||
};
|
||||
if !flag_no_specials && get_archived_cnt(context).await? > 0 {
|
||||
if ids.is_empty() && flag_add_alldone_hint {
|
||||
|
||||
Reference in New Issue
Block a user