Skip to content

Commit

Permalink
Make lookback window range inclusive
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Garfield committed Mar 1, 2022
1 parent 4ae75f7 commit ced6d04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use {
},
};

const LOOKBACK_WINDOW: i64 = 60 * 10; // Number of seconds to lookback
const LOOKBACK_WINDOW: i64 = 60 * 15; // Number of seconds to lookback

pub fn execute_tasks(
client: Arc<Client>,
Expand Down Expand Up @@ -41,7 +41,7 @@ fn execute_tasks_in_lookback_window(
) {
// Spawn threads to execute tasks in lookback window
let mut handles = vec![];
for t in (blocktime - LOOKBACK_WINDOW)..blocktime {
for t in (blocktime - LOOKBACK_WINDOW)..=blocktime {
let r_cache = cache.read().unwrap();
r_cache.index.get(&t).and_then(|keys| {
for key in keys.iter() {
Expand Down

0 comments on commit ced6d04

Please sign in to comment.