You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe Resque hooks are clashing with ActiveJob ones.
Let 's see an example with the before_enqueue hook.
In a Resque job you can define the before_enqueue method as a hook to be executed before enqueueing; if false is returned the enqueuing does not happen (docs):
classMyJob < ApplicationJobdefbefore_enqueue# do somethingendend
In ActiveJob, you can use the before_enqueue method to add a hook to be run before enqueueing (api docs):
# Workaround for this problem: https://github.com/resque/resque/issues/1787# Modify conflicting hooks (Resque vs ActiveJob) so that Resque hooks end with and underscore and# so we can still use them as `before_enqueue_whatever`moduleResquemodulePlugindefbefore_hooks(job)get_hook_names(job,'before_perform_')enddefaround_hooks(job)get_hook_names(job,'around_perform_')enddefafter_hooks(job)get_hook_names(job,'after_perform_')enddefafter_enqueue_hooks(job)get_hook_names(job,'after_enqueue_')enddefbefore_enqueue_hooks(job)get_hook_names(job,'before_enqueue_')endendend
I believe Resque hooks are clashing with ActiveJob ones.
Let 's see an example with the
before_enqueue
hook.In a Resque job you can define the
before_enqueue
method as a hook to be executed before enqueueing; if false is returned the enqueuing does not happen (docs):In ActiveJob, you can use the
before_enqueue
method to add a hook to be run before enqueueing (api docs):Because of this clash:
before_enqueue
method if it existsThe conflicting hooks are: after_enqueue, after_perform, around_enqueue, around_perform, before_enqueue, before_perform
The text was updated successfully, but these errors were encountered: