Skip to content

Commit

Permalink
update: added error to job metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
heemankv committed Jul 23, 2024
1 parent c13a576 commit f1e1a76
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/orchestrator/src/jobs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ pub async fn verify_job(id: Uuid) -> Result<()> {
JobVerificationStatus::Verified => {
config.database().update_job_status(&job, JobStatus::Completed).await?;
}
JobVerificationStatus::Rejected(_) => {
// TODO: change '_' to 'e' and add error 'e' to metadata of job status.
JobVerificationStatus::Rejected(e) => {
config.database().update_job_status(&job, JobStatus::VerificationFailed).await?;
let mut metadata = job.metadata.clone();
metadata.insert("error".to_string(), e);
config.database().update_metadata(&job, metadata).await?;

// retry job processing if we haven't exceeded the max limit
let process_attempts = get_u64_from_metadata(&job.metadata, JOB_PROCESS_ATTEMPT_METADATA_KEY)?;
Expand Down

0 comments on commit f1e1a76

Please sign in to comment.