Lowered stale timing again

This commit is contained in:
ClementTsang 2020-01-28 22:48:29 -05:00
parent 2d25abaa16
commit 4f31c6ee02
3 changed files with 3 additions and 4 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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();
});