mirror of
https://github.com/chatmail/core.git
synced 2026-08-14 04:57:26 +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> =
|
||||
@@ -256,7 +256,8 @@ ORDER BY timestamp DESC, id DESC LIMIT 1)"
|
||||
).await?
|
||||
} else {
|
||||
// show normal chatlist
|
||||
context.sql.query_map_vec(concat!(
|
||||
let start = Time::now();
|
||||
let items = context.sql.query_map_vec(concat!(
|
||||
"SELECT c.id, m.id
|
||||
FROM chats c
|
||||
LEFT JOIN msgs m
|
||||
@@ -268,7 +269,9 @@ ORDER BY timestamp DESC, id DESC LIMIT 1)"
|
||||
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