mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 19:06:35 +03:00
feat: migrations: Use tools::Time to measure time for logging
There's a comment in `tools` that tells to use `tools::Time` instead of `Instant` because on Android the latter doesn't advance in the deep sleep mode. The only place except `migrations` where `Instant` is used is tests, but we don't run CI on Android. It's unlikely that Delta Chat goes to the deep sleep while executing migrations, but still possible, so let's use `tools::Time` as everywhere else.
This commit is contained in:
@@ -14,7 +14,8 @@ use std::str::from_utf8;
|
||||
// `Instant` may use `libc::clock_gettime(CLOCK_MONOTONIC)`, e.g. on Android, and does not advance
|
||||
// while being in deep sleep mode, we use `SystemTime` instead, but add an alias for it to document
|
||||
// why `Instant` isn't used in those places. Also this can help to switch to another clock impl if
|
||||
// we find any.
|
||||
// we find any. Another reason is that `Instant` may reintroduce panics in the future versions:
|
||||
// https://doc.rust-lang.org/1.87.0/std/time/struct.Instant.html#method.elapsed.
|
||||
use std::time::Duration;
|
||||
pub use std::time::SystemTime as Time;
|
||||
#[cfg(not(test))]
|
||||
|
||||
Reference in New Issue
Block a user