Skip to content

Commit

Permalink
Process follow-up job response.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Oct 30, 2023
1 parent 5d22183 commit bef9c2c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion deepwell/src/services/job/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
mod prelude {
pub use super::super::prelude::*;
pub use super::service::{
JOB_QUEUE_DELAY, JOB_QUEUE_MAXIMUM_SIZE, JOB_QUEUE_NAME, JOB_QUEUE_PROCESS_TIME,
JobService, JOB_QUEUE_DELAY, JOB_QUEUE_MAXIMUM_SIZE, JOB_QUEUE_NAME,
JOB_QUEUE_PROCESS_TIME,
};
pub use super::structs::*;
}
Expand Down
12 changes: 11 additions & 1 deletion deepwell/src/services/job/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,17 @@ impl JobWorker {
}
};

// XXX process 'next', queue job
// Add follow-up job to queue, if required.
match next {
NextJob::Done => debug!("Job execution finished, no follow-up job to add"),
NextJob::Next { job, delay } => {
debug!("Job execution finished, follow-up job has been produced");
trace!("* Job: {job:?}");
trace!("* Delay: {delay:?}");

JobService::queue_job(ctx, &job, delay).await?;
}
}

trace!("Job execution finished, cleaning up");
self.rsmq.delete_message(JOB_QUEUE_NAME, &data.id).await?;
Expand Down

0 comments on commit bef9c2c

Please sign in to comment.