From 4f31c6ee02e7f31c84f894d9e83106d7b039108e Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Tue, 28 Jan 2020 22:48:29 -0500 Subject: Lowered stale timing again --- src/app/data_farmer.rs | 2 +- src/constants.rs | 3 +-- src/main.rs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/app/data_farmer.rs b/src/app/data_farmer.rs index 44d69f62..369845e3 100644 --- a/src/app/data_farmer.rs +++ b/src/app/data_farmer.rs @@ -82,7 +82,7 @@ impl DataCollection { let mut remove_index = 0; for entry in &self.timed_data_vec { - if current_time.duration_since(entry.0).as_millis() > max_time_millis { + if current_time.duration_since(entry.0).as_millis() >= max_time_millis { remove_index += 1; } else { break; diff --git a/src/constants.rs b/src/constants.rs index a0811da7..bd2edc9d 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -1,5 +1,4 @@ -// TODO: Store like three minutes of data, then change how much is shown based on scaling! -pub const STALE_MAX_MILLISECONDS: u128 = 180 * 1000; // We wish to store at most 180 seconds worth of data. This may change in the future, or be configurable. +pub const STALE_MAX_MILLISECONDS: u128 = 60 * 1000; // How long to store data pub const TIME_STARTS_FROM: u64 = 60 * 1000; pub const TICK_RATE_IN_MILLISECONDS: u64 = 200; // How fast the screen refreshes pub const DEFAULT_REFRESH_RATE_IN_MILLISECONDS: u128 = 1000; diff --git a/src/main.rs b/src/main.rs index 49a9cd10..dde51164 100644 --- a/src/main.rs +++ b/src/main.rs @@ -181,7 +181,7 @@ fn main() -> error::Result<()> { let tx = tx.clone(); thread::spawn(move || loop { thread::sleep(Duration::from_millis( - constants::STALE_MAX_MILLISECONDS as u64, + constants::STALE_MAX_MILLISECONDS as u64 + 5000, )); tx.send(Event::Clean).unwrap(); }); -- cgit v1.2.3