Reuse validated checkpoint executors during native preview
This commit is contained in:
1 parent
69de8a6599
commit
43231a48c0
8 files changed
+160
-50
No files matched your search
@@ -141,7 +141,7 @@ impl FormatImage {
|
||||
read: impl FnMut(&mut F, &Path) -> Result<T, String>,
|
||||
date: impl FnMut(&mut F, &str, &str) -> Result<Option<String>, String>,
|
||||
) -> Result<Executor, String> {
|
||||
self.validate_job(profile, input_profile, files, read, date)?;
|
||||
self.validate_job_inputs(profile, input_profile, files, read, date)?;
|
||||
Ok(Executor::new_format_job(
|
||||
self.state.with_job_time(time),
|
||||
self.sources,
|
||||
@@ -181,7 +181,7 @@ impl FormatImage {
|
||||
read: impl FnMut(&mut F, &Path) -> Result<T, String>,
|
||||
date: impl FnMut(&mut F, &str, &str) -> Result<Option<String>, String>,
|
||||
) -> Result<Executor, String> {
|
||||
self.validate_job(profile, input_profile, files, read, date)?;
|
||||
self.validate_job_inputs(profile, input_profile, files, read, date)?;
|
||||
Ok(Executor::new_format_job(
|
||||
self.state.clone().with_job_time(time),
|
||||
self.sources.clone(),
|
||||
@@ -191,7 +191,8 @@ impl FormatImage {
|
||||
))
|
||||
}
|
||||
|
||||
fn validate_job<F, T: AsRef<[u8]>>(
|
||||
/// Check the format profile and every required input without forking a job.
|
||||
pub fn validate_job_inputs<F, T: AsRef<[u8]>>(
|
||||
&self,
|
||||
profile: Profile,
|
||||
input_profile: InputProfile,
|
||||
|
||||
Reference in new issue
Block a user