Lowered stale timing again
This commit is contained in:
parent
2d25abaa16
commit
4f31c6ee02
|
@ -82,7 +82,7 @@ impl DataCollection {
|
||||||
|
|
||||||
let mut remove_index = 0;
|
let mut remove_index = 0;
|
||||||
for entry in &self.timed_data_vec {
|
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;
|
remove_index += 1;
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -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 = 60 * 1000; // How long to store data
|
||||||
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 TIME_STARTS_FROM: u64 = 60 * 1000;
|
pub const TIME_STARTS_FROM: u64 = 60 * 1000;
|
||||||
pub const TICK_RATE_IN_MILLISECONDS: u64 = 200; // How fast the screen refreshes
|
pub const TICK_RATE_IN_MILLISECONDS: u64 = 200; // How fast the screen refreshes
|
||||||
pub const DEFAULT_REFRESH_RATE_IN_MILLISECONDS: u128 = 1000;
|
pub const DEFAULT_REFRESH_RATE_IN_MILLISECONDS: u128 = 1000;
|
||||||
|
|
|
@ -181,7 +181,7 @@ fn main() -> error::Result<()> {
|
||||||
let tx = tx.clone();
|
let tx = tx.clone();
|
||||||
thread::spawn(move || loop {
|
thread::spawn(move || loop {
|
||||||
thread::sleep(Duration::from_millis(
|
thread::sleep(Duration::from_millis(
|
||||||
constants::STALE_MAX_MILLISECONDS as u64,
|
constants::STALE_MAX_MILLISECONDS as u64 + 5000,
|
||||||
));
|
));
|
||||||
tx.send(Event::Clean).unwrap();
|
tx.send(Event::Clean).unwrap();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue