Skip to content

Commit

Permalink
fix: avoid reliability impact on indexing behind
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodus committed Sep 22, 2023
1 parent 91366e3 commit 47bcb6d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions indexer-selection/src/indexing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ impl IndexingState {
result: Result<(), IndexerErrorObservation>,
) {
self.last_use = self.last_use.max(Instant::now() - duration);
self.reliability.current_mut().observe(result.is_ok());
match result {
Ok(()) => self.perf_success.current_mut().observe(duration),
Err(err) => {
Expand All @@ -100,10 +99,16 @@ impl IndexingState {
IndexerErrorObservation::IndexingBehind {
latest_query_block,
latest_block,
} => self.observe_indexing_behind(latest_query_block, latest_block),
} => {
self.observe_indexing_behind(latest_query_block, latest_block);
// Avoid negative impact on reliability score resulting from our predictions
// of the indexer's block status.
return;
}
};
}
};
self.reliability.current_mut().observe(result.is_ok());
}

fn observe_indexing_behind(&mut self, latest_query_block: u64, latest_block: u64) {
Expand Down

0 comments on commit 47bcb6d

Please sign in to comment.