mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 08:56:30 +03:00
use std::time::SystemTime for uptime calculation
std::time::Instant does not count eg. doze-time on android
This commit is contained in:
@@ -22,7 +22,7 @@ use crate::message::{self, Message, MessengerMessage, MsgId};
|
|||||||
use crate::param::Params;
|
use crate::param::Params;
|
||||||
use crate::smtp::Smtp;
|
use crate::smtp::Smtp;
|
||||||
use crate::sql::Sql;
|
use crate::sql::Sql;
|
||||||
use std::time::Instant;
|
use std::time::SystemTime;
|
||||||
|
|
||||||
/// Callback function type for [Context]
|
/// Callback function type for [Context]
|
||||||
///
|
///
|
||||||
@@ -59,7 +59,7 @@ pub struct Context {
|
|||||||
/// Mutex to avoid generating the key for the user more than once.
|
/// Mutex to avoid generating the key for the user more than once.
|
||||||
pub generating_key_mutex: Mutex<()>,
|
pub generating_key_mutex: Mutex<()>,
|
||||||
pub translated_stockstrings: RwLock<HashMap<usize, String>>,
|
pub translated_stockstrings: RwLock<HashMap<usize, String>>,
|
||||||
creation_time: Instant,
|
creation_time: SystemTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
@@ -141,7 +141,7 @@ impl Context {
|
|||||||
perform_inbox_jobs_needed: Arc::new(RwLock::new(false)),
|
perform_inbox_jobs_needed: Arc::new(RwLock::new(false)),
|
||||||
generating_key_mutex: Mutex::new(()),
|
generating_key_mutex: Mutex::new(()),
|
||||||
translated_stockstrings: RwLock::new(HashMap::new()),
|
translated_stockstrings: RwLock::new(HashMap::new()),
|
||||||
creation_time: std::time::Instant::now(),
|
creation_time: std::time::SystemTime::now(),
|
||||||
};
|
};
|
||||||
|
|
||||||
ensure!(
|
ensure!(
|
||||||
|
|||||||
Reference in New Issue
Block a user