From 6f62318fdcf304be7fa4a60ef5671da15193f8f8 Mon Sep 17 00:00:00 2001 From: christn Date: Mon, 5 Aug 2024 19:29:14 +0800 Subject: [PATCH] refactor: last_synced -> last_seen --- src/phoenix/mod.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/phoenix/mod.rs b/src/phoenix/mod.rs index d50e6f8..ac83f60 100644 --- a/src/phoenix/mod.rs +++ b/src/phoenix/mod.rs @@ -100,14 +100,14 @@ impl Alarm { struct Phoenix { name: &'static str, - last_synced: DateTime, + last_seen: DateTime, num_unsynced_nodes: usize, monitor: Box, } impl Phoenix { fn is_age_over_limit(&self) -> bool { - let age = Utc::now() - self.last_synced; + let age = Utc::now() - self.last_seen; debug!( name = self.name, @@ -118,9 +118,9 @@ impl Phoenix { age >= *PHOENIX_MAX_LIFESPAN } - fn set_last_seen(&mut self, last_synced: DateTime) { - debug!(name = self.name, ?last_synced, "setting last seen"); - self.last_synced = last_synced; + fn set_last_seen(&mut self, last_seen: DateTime) { + debug!(name = self.name, ?last_seen, "setting last seen"); + self.last_seen = last_seen; } } @@ -139,13 +139,13 @@ async fn run_alarm_loop(last_checked: Arc>>) -> Result<()> { let mut phoenixes = [ Phoenix { - last_synced: Utc::now(), + last_seen: Utc::now(), monitor: Box::new(ConsensusNodeMonitor::new()), num_unsynced_nodes: APP_CONFIG.consensus_nodes.len(), name: "consensus node", }, Phoenix { - last_synced: Utc::now(), + last_seen: Utc::now(), num_unsynced_nodes: APP_CONFIG.validation_nodes.len(), monitor: Box::new(ValidationNodeMonitor::new()), name: "validation node",