-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathstate.rs
More file actions
22 lines (21 loc) · 859 Bytes
/
state.rs
File metadata and controls
22 lines (21 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use graph::{
components::store::EntityLfuCache, prelude::BlockPtr, util::backoff::ExponentialBackoff,
};
use std::time::Instant;
pub struct IndexingState {
/// `true` -> `false` on the first run
pub should_try_unfail_non_deterministic: bool,
/// Backoff used for the retry mechanism on non-deterministic errors
pub backoff: ExponentialBackoff,
/// Related to field above `backoff`
///
/// Resets to `Instant::now` every time:
/// - The time THRESHOLD is passed
/// - Or the subgraph has triggers for the block
pub skip_ptr_updates_timer: Instant,
pub entity_lfu_cache: EntityLfuCache,
pub cached_head_ptr: Option<BlockPtr>,
/// Set to `true` once postponed indexes have been created. This
/// ensures we only trigger index creation once per subgraph run.
pub postponed_indexes_created: bool,
}