Skip to content

Commit

Permalink
refactor: removed job id from panic message, was redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
mohiiit committed Nov 9, 2024
1 parent c470f82 commit c17d7a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/orchestrator/src/jobs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ pub async fn process_job(id: Uuid, config: Arc<Config>) -> Result<(), JobError>
return move_job_to_failed(
&job,
config.clone(),
format!("Job handler panicked in job with id: {} and panic message: {}", id, panic_msg),
format!("Job handler panicked with message: {}", panic_msg),
)
.await;
}
Expand Down
12 changes: 5 additions & 7 deletions crates/orchestrator/src/tests/jobs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,11 @@ async fn process_job_handles_panic() {
let job_in_db = database_client.get_job_by_id(job_item.id).await.unwrap().unwrap();
assert_eq!(job_in_db.status, JobStatus::Failed);
assert!(
job_in_db.metadata.get(JOB_METADATA_FAILURE_REASON).unwrap().contains(
format!(
"Job handler panicked in job with id: {} and panic message: Simulated panic in process_job",
job_item.id
)
.as_str()
)
job_in_db
.metadata
.get(JOB_METADATA_FAILURE_REASON)
.unwrap()
.contains("Job handler panicked with message: Simulated panic in process_job")
);
}

Expand Down

0 comments on commit c17d7a9

Please sign in to comment.