mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +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::param::{Param, Params};
|
||||||
use crate::stock_str;
|
use crate::stock_str;
|
||||||
use crate::summary::Summary;
|
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.
|
/// Regex to find out if a query should filter by unread messages.
|
||||||
pub static IS_UNREAD_FILTER: LazyLock<regex::Regex> =
|
pub static IS_UNREAD_FILTER: LazyLock<regex::Regex> =
|
||||||
@@ -264,7 +264,8 @@ impl Chatlist {
|
|||||||
).await?
|
).await?
|
||||||
} else {
|
} else {
|
||||||
// show normal chatlist
|
// show normal chatlist
|
||||||
context.sql.query_map_vec(
|
let start = Time::now();
|
||||||
|
let items = context.sql.query_map_vec(
|
||||||
"SELECT c.id, m.id
|
"SELECT c.id, m.id
|
||||||
FROM chats c
|
FROM chats c
|
||||||
LEFT JOIN msgs m
|
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;",
|
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),
|
(skip_id, ChatVisibility::Archived, ChatVisibility::Pinned),
|
||||||
process_row,
|
process_row,
|
||||||
).await?
|
).await?;
|
||||||
|
info!(
|
||||||
|
context,
|
||||||
|
"chatlist built in {:?}.",
|
||||||
|
time_elapsed(&start),
|
||||||
|
);
|
||||||
|
items
|
||||||
};
|
};
|
||||||
if !flag_no_specials && get_archived_cnt(context).await? > 0 {
|
if !flag_no_specials && get_archived_cnt(context).await? > 0 {
|
||||||
if ids.is_empty() && flag_add_alldone_hint {
|
if ids.is_empty() && flag_add_alldone_hint {
|
||||||
|
|||||||
Reference in New Issue
Block a user