should_create_snapshot

Function should_create_snapshot 

Source
pub fn should_create_snapshot(
    local_seq: u64,
    last_snapshot_seq: Option<u64>,
    hours_since_snapshot: Option<u64>,
) -> bool
Expand description

Check whether it’s time to create a new snapshot.

Returns true if:

  • changesets_since_snapshot >= the changeset threshold (100), OR
  • hours_since_snapshot >= the time threshold (24h), OR
  • No snapshot has ever been created (last_snapshot_seq is None) AND at least one changeset has been pushed.