feat: improve IMAP loop logs

Only inbox loop is changed because non-inbox loop is going to be removed
together with `mvbox_move`.

Added transport IDs to the log and logging around quota updates.
Removed some logs that add noise,
like logging that IDLE is supported each time right before using it.
This commit is contained in:
link2xt
2026-03-24 05:43:20 +01:00
committed by l
parent 76e2c36d85
commit c99b8a4482
6 changed files with 90 additions and 30 deletions

View File

@@ -123,6 +123,10 @@ impl Context {
/// in case for some providers the quota is always at ~100%
/// and new space is allocated as needed.
pub(crate) async fn update_recent_quota(&self, session: &mut ImapSession) -> Result<()> {
let transport_id = session.transport_id();
info!(self, "Transport {transport_id}: Updating quota.");
let quota = if session.can_check_quota() {
let folders = get_watched_folders(self).await?;
get_unique_quota_roots_and_usage(session, folders).await
@@ -149,18 +153,22 @@ impl Context {
.await?;
}
}
Err(err) => warn!(self, "cannot get highest quota usage: {:#}", err),
Err(err) => warn!(
self,
"Transport {transport_id}: Cannot get highest quota usage: {err:#}"
),
}
}
self.quota.write().await.insert(
session.transport_id(),
transport_id,
QuotaInfo {
recent: quota,
modified: tools::Time::now(),
},
);
info!(self, "Transport {transport_id}: Updated quota.");
self.emit_event(EventType::ConnectivityChanged);
Ok(())
}