only check for schedule if not a flow step

This commit is contained in:
Ruben Fiszel
2022-07-31 20:30:30 +02:00
parent 7f55e7a498
commit 03ed38e9b2
3 changed files with 15 additions and 3 deletions
+4 -1
View File
@@ -1331,6 +1331,7 @@ pub async fn add_completed_job(
#[instrument(level = "trace", skip_all)]
pub async fn postprocess_queued_job(
is_flow_step: bool,
schedule_path: Option<String>,
script_path: Option<String>,
w_id: &str,
@@ -1338,7 +1339,9 @@ pub async fn postprocess_queued_job(
db: &DB,
) -> crate::error::Result<()> {
let _ = delete_job(db, w_id, job_id).await?;
schedule_again_if_scheduled(schedule_path, script_path, &w_id, db).await?;
if !is_flow_step {
schedule_again_if_scheduled(schedule_path, script_path, &w_id, db).await?;
}
Ok(())
}
+10 -2
View File
@@ -139,6 +139,7 @@ pub async fn run_worker(
{
let job = job2.clone();
let _ = postprocess_queued_job(
job.is_flow_step,
job.schedule_path,
job.script_path,
&job2.workspace_id,
@@ -249,8 +250,15 @@ async fn handle_queued_job(
}
};
let _ =
postprocess_queued_job(job.schedule_path, job.script_path, &w_id, job_id, db).await;
let _ = postprocess_queued_job(
job.is_flow_step,
job.schedule_path,
job.script_path,
&w_id,
job_id,
db,
)
.await;
}
}
Ok(())
+1
View File
@@ -206,6 +206,7 @@ pub async fn update_flow_status_after_job_completion(
if done {
postprocess_queued_job(
flow_job.is_flow_step,
flow_job.schedule_path.clone(),
flow_job.script_path.clone(),
&w_id,