diff options
author | ClementTsang <clementjhtsang@gmail.com> | 2020-01-28 22:48:29 -0500 |
---|---|---|
committer | ClementTsang <clementjhtsang@gmail.com> | 2020-01-28 22:48:51 -0500 |
commit | 4f31c6ee02e7f31c84f894d9e83106d7b039108e (patch) | |
tree | 0a41d1cc095a5477c3e0e1a3982170c28918277d /src | |
parent | 2d25abaa16b935b54b582a4b5a34dd68d758ad23 (diff) |
Lowered stale timing again
Diffstat (limited to 'src')
-rw-r--r-- | src/app/data_farmer.rs | 2 | ||||
-rw-r--r-- | src/constants.rs | 3 | ||||
-rw-r--r-- | src/main.rs | 2 |
3 files changed, 3 insertions, 4 deletions
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(); }); |