summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorClementTsang <clementjhtsang@gmail.com>2020-01-28 22:48:29 -0500
committerClementTsang <clementjhtsang@gmail.com>2020-01-28 22:48:51 -0500
commit4f31c6ee02e7f31c84f894d9e83106d7b039108e (patch)
tree0a41d1cc095a5477c3e0e1a3982170c28918277d /src
parent2d25abaa16b935b54b582a4b5a34dd68d758ad23 (diff)
Lowered stale timing again
Diffstat (limited to 'src')
-rw-r--r--src/app/data_farmer.rs2
-rw-r--r--src/constants.rs3
-rw-r--r--src/main.rs2
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();
});