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

Call afterPerform in performInline on error #773

Merged
merged 1 commit into from
Mar 21, 2022
Merged

Call afterPerform in performInline on error #773

merged 1 commit into from
Mar 21, 2022

Conversation

stellarhoof
Copy link
Contributor

@stellarhoof stellarhoof commented Mar 19, 2022

This PR makes it so worker.performInline calls Plugins' afterPerform method when the perform function throws an error.

Fixes #772

This PR makes it so `worker.performInline` calls Plugins' `afterPerform`
method when the `perform` function throws an error.
@evantahler
Copy link
Member

evantahler commented Mar 19, 2022

Nice work!

Can you confirm that this is the same behavior of a “normally” worked job? I believe that right now on main, in both the ‘inline’ and regular cases that a job throwing prevents the “after” plugin steps from running.

If we need to change both methods of working a job, this is likely a breaking change, and we will need to think about the migration path a little more - maybe this behavior becomes an option.

@stellarhoof
Copy link
Contributor Author

I believe that right now on main, in both the ‘inline’ and regular cases that a job throwing prevents the “after” plugin steps from running.

In both methods (perform and now performInline) the job's perform is wrapped in a try/catch so the afterPerform method can be run.

Can you confirm that this is the same behavior of a “normally” worked job?

The behavior is the same.

@evantahler evantahler merged commit 23f7cc6 into actionhero:main Mar 21, 2022
@evantahler
Copy link
Member

Thanks @stellarhoof!

@evantahler
Copy link
Member

Released in https://github.com/actionhero/node-resque/releases/tag/v9.1.6

@stellarhoof stellarhoof deleted the feature/perform-inline-fix branch March 21, 2022 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

performInline: afterPerform does not get called on perform error
2 participants