From c52d4b5ae43c202569c8801c312c2b56954ff8a0 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 25 Oct 2026 23:00:56 +0100 Subject: add clock module The Clock module is the system clock that every unix timestamp new goes through. It comes with an offset that only tests can set. --- src/api/peers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/api') diff --git a/src/api/peers.rs b/src/api/peers.rs index dc4bd3b..a9694f7 100644 --- a/src/api/peers.rs +++ b/src/api/peers.rs @@ -16,7 +16,7 @@ use utoipa::ToSchema; use super::store_status; use crate::document::replica::Epoch; use crate::document::store; -use crate::state::{AppState, HelloState, Incidents, Liveness, PeerState, unix_millis}; +use crate::state::{AppState, HelloState, Incidents, Liveness, PeerState}; use crate::swarm::peer::forgotten_path; use crate::transport::traffic::PeerTraffic; @@ -232,7 +232,7 @@ pub(crate) async fn delete_peer( } } - let record = serde_json::json!({ "at": unix_millis(), "by": state.local_id() }); + let record = serde_json::json!({ "at": state.clock.now_millis(), "by": state.local_id() }); let peer_clone = peer.clone(); state -- cgit v1.3.1