Skip to content

Commit

Permalink
widen both sides of the witness loader window to 2x ingestor roll up …
Browse files Browse the repository at this point in the history
…time
  • Loading branch information
andymck committed Aug 14, 2023
1 parent ac4b861 commit d2441b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions iot_verifier/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl Loader {
// if there is no last timestamp in the meta db, the window start point will be
// Now() - (window_width * 4)
// as such data loading is always behind by a value equal to window_width * 4
let window_default_lookback = now - (self.window_width * 4);
let window_default_lookback = now - (self.window_width * 5);
// cap the starting point of the window at the max below.
let window_max_lookback = now - self.max_lookback_age;
tracing::info!(
Expand All @@ -110,7 +110,7 @@ impl Loader {
.unwrap_or(window_default_lookback)
.max(window_max_lookback);
let before_max = after + self.window_width;
let before = (now - (self.window_width * 3)).min(before_max);
let before = (now - (self.window_width * 4)).min(before_max);
let cur_window_width = before - after;
tracing::info!(
"sliding window, after: {after}, before: {before}, cur width: {:?}, required width: {:?}",
Expand Down Expand Up @@ -190,8 +190,8 @@ impl Loader {
FileType::IotWitnessIngestReport,
&self.ingest_store,
gateway_cache,
after - self.ingestor_rollup_time,
before + self.ingestor_rollup_time,
after - (self.ingestor_rollup_time * 2),
before + (self.ingestor_rollup_time * 2),
None,
Some(&filter),
)
Expand Down

0 comments on commit d2441b0

Please sign in to comment.