Refactor sessions management

This commit is contained in:
2022-04-01 22:51:33 +02:00
parent 372dfa3f31
commit 41ee80a077
5 changed files with 74 additions and 30 deletions

View File

@ -1 +1,2 @@
pub mod err;
pub mod err;
pub mod time;

6
src/utils/time.rs Normal file
View File

@ -0,0 +1,6 @@
use std::time::{SystemTime, UNIX_EPOCH};
/// Get the current time since epoch
pub fn time() -> u64 {
SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs()
}