fix(bin): calculate ETA only if EntitiesCheckpoint is present (#3206)

This commit is contained in:
Alexey Shekhirin
2023-06-17 01:46:43 +01:00
committed by GitHub
parent d6092cf1d3
commit bb1ffd059e
2 changed files with 23 additions and 38 deletions

View File

@ -278,9 +278,9 @@ struct Eta {
}
impl Eta {
/// Update the ETA given the checkpoint.
/// Update the ETA given the checkpoint, if possible.
fn update(&mut self, checkpoint: StageCheckpoint) {
let current = checkpoint.entities();
let Some(current) = checkpoint.entities() else { return };
if let Some(last_checkpoint_time) = &self.last_checkpoint_time {
let processed_since_last = current.processed - self.last_checkpoint.processed;