Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct discrete_execution#status method #1092

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

coreyaus
Copy link
Contributor

The order of the conditions in this discrete_execution#status method was previously incorrect, which meant it was not possible for the :discarded status to ever be returned

If error.present? then the status should either be :retried or :discarded, depending on whether the parent job has a finished_at timestamp. However, the more specific check of error.present? && job.finished_at.present? was left in the elsif branch. That meant the value of :retried was always returned whenever the more generic if error.present? condition returned true (without ever checking the value of job.finished_at)

The order of the conditions in this `discrete_execution#status` method was previously incorrect, which meant it was not possible for the `:discarded` status to ever be returned

If `error.present?` then the status should either be `:retried` or `:discarded`, depending on whether the parent job has a `finished_at` timestamp. However, the more specific check of `error.present? && job.finished_at.present?` was left in the `elsif` branch. That meant the value of `:retried` was always returned whenever the more generic `if error.present?` condition returned true (without ever checking the value of `job.finished_at`)
@bensheldon bensheldon merged commit 46626e6 into bensheldon:main Sep 28, 2023
20 checks passed
@bensheldon
Copy link
Owner

@coreyaus thank you for catching that! 🙇🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants