Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/mitsuhiko/coda
Browse files Browse the repository at this point in the history
  • Loading branch information
iambriccardo committed Aug 25, 2023
2 parents c3ec900 + 7f2e1f0 commit 3000258
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions coda-supervisor/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,13 @@ impl Controller {
}
Cmd::PublishTaskResult(cmd) => {
let outcome = Outcome::Success(cmd.result);
event!(
Level::DEBUG,
task_id = display(cmd.task_id),
task_key = display(cmd.task_key),
outcome = debug(&outcome),
"publish task result",
);
if let Some(interests) = self.storage.store_task_result(
cmd.workflow_run_id,
cmd.task_key,
Expand Down Expand Up @@ -431,12 +438,27 @@ impl Controller {
bail!("command cannot be sent to supervisor")
}
Cmd::TaskFailed(cmd) => {
if let Some(retry_task) =
if let Some(task) =
self.storage
.handle_task_failed(cmd.workflow_run_id, cmd.task_id, cmd.retryable)
{
self.storage.enqueue_task(retry_task).await?;
event!(
Level::DEBUG,
task_id = display(task.task_id),
task_key = display(task.task_key),
task_name = task.task_name,
retries_remaining = task.retries_remaining,
"retry task",
);
self.storage.enqueue_task(task).await?;
} else {
event!(
Level::DEBUG,
task_id = display(cmd.task_id),
task_key = display(cmd.task_key),
failed = true,
"publish task result",
);
let outcome = Outcome::Failure(Value::Null);
if let Some(interests) = self.storage.store_task_result(
cmd.workflow_run_id,
Expand Down

0 comments on commit 3000258

Please sign in to comment.