mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 02:16:29 +03:00
log time that the function took
This commit is contained in:
@@ -448,6 +448,10 @@ impl Context {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let address = self.get_primary_self_addr().await?;
|
||||
let time_start = std::time::SystemTime::now();
|
||||
info!(self, "background_fetch started fetching {address}");
|
||||
|
||||
let _pause_guard = self.scheduler.pause(self.clone()).await?;
|
||||
|
||||
// connection
|
||||
@@ -467,6 +471,12 @@ impl Context {
|
||||
warn!(self, "Failed to update quota: {:#}.", err);
|
||||
}
|
||||
|
||||
info!(
|
||||
self,
|
||||
"background_fetch done for {address} took {:?}",
|
||||
time_start.elapsed().unwrap_or_default()
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user