fix metadata removal for ExecutionCountRestartHelper (#2705)

This commit is contained in:
Henry Chu 2024-11-19 21:36:19 +08:00 committed by GitHub
parent b3d3c38b29
commit 7623aa46f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -699,12 +699,12 @@ impl ExecutionCountRestartHelper {
}
/// Clear progress for the stage this wrapper wraps.
pub fn clear_progress<S>(&mut self, state: &mut S) -> Result<(), Error>
pub fn clear_progress<S>(&mut self, state: &mut S, name: &str) -> Result<(), Error>
where
S: HasMetadata,
S: HasNamedMetadata,
{
self.started_at_execs = None;
let _metadata = state.remove_metadata::<ExecutionCountRestartHelperMetadata>();
let _metadata = state.remove_named_metadata::<ExecutionCountRestartHelperMetadata>(name);
debug_assert!(_metadata.is_some(), "Called clear_progress, but should_restart was not called before (or did mutational stages get nested?)");
Ok(())
}

View File

@ -260,7 +260,7 @@ where
}
fn clear_progress(&mut self, state: &mut Self::State) -> Result<(), Error> {
self.restart_helper.clear_progress(state)
self.restart_helper.clear_progress(state, &self.name)
}
fn perform(

View File

@ -296,7 +296,7 @@ where
}
fn clear_progress(&mut self, state: &mut Self::State) -> Result<(), Error> {
self.restart_helper.clear_progress(state)
self.restart_helper.clear_progress(state, &self.name)
}
}