fix: clean job dirs between flow locks

This commit is contained in:
Ruben Fiszel
2025-03-26 23:23:04 +01:00
parent ec886a688a
commit b747e5e2f4
@@ -1,5 +1,6 @@
use std::borrow::Cow;
use std::collections::HashMap;
use std::fs::{create_dir_all, remove_dir_all};
use std::path::{Component, Path, PathBuf};
use async_recursion::async_recursion;
@@ -281,7 +282,9 @@ pub async fn handle_dependency_job(
)
.execute(db)
.await?;
return Err(Error::ExecutionErr(format!("Error creating schema validator: {e}")))
return Err(Error::ExecutionErr(format!(
"Error creating schema validator: {e}"
)));
}
},
_ => match preview_data {
@@ -1056,6 +1059,12 @@ async fn lock_modules<'c>(
modified_ids.push(e.id.clone());
remove_dir_all(job_dir).map_err(|e| {
Error::ExecutionErr(format!("Error removing job dir for flow step lock: {e}"))
})?;
create_dir_all(job_dir).map_err(|e| {
Error::ExecutionErr(format!("Error creating job dir for flow step lock: {e}"))
})?;
let new_lock = capture_dependency_job(
&job.id,
&language,