summaryrefslogtreecommitdiffstats
path: root/src/api
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-25 23:00:56 +0100
committertv <tv@krebsco.de>2026-10-25 23:00:56 +0100
commit539f84c217aec506c894379643e97c20624dc72c (patch)
tree4cc71b5c3282f589144a02d9a4bf236ccc9cec57 /src/api
parentea0b45fd82d421c97cd3a52c75979adae97678b0 (diff)
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.
Diffstat (limited to 'src/api')
-rw-r--r--src/api/peers.rs4
1 files changed, 2 insertions, 2 deletions
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