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
In the perform! method in job.rb, we're firing a bunch of hooks:
defperform!Quebert.config.before_job(self)Quebert.config.around_job(self)# Honor the timeout and kill the job in ruby-space. Beanstalk# should be cleaning up this job and returning it to the queue# as well.val= ::Timeout.timeout(ttr,Job::Timeout){perform(*args)}Quebert.config.around_job(self)Quebert.config.after_job(self)valend
Get rid of these and replace with methods on the job class itself.
defperform!before_perform# Honor the timeout and kill the job in ruby-space. Beanstalk# should be cleaning up this job and returning it to the queue# as well.# TODO - Implement around_perform handler ...val= ::Timeout.timeout(ttr,Job::Timeout){perform(*args)}after_performvalenddefbefore_performenddefafter_performenddefaround_performend
A common reason to have hooks is to deal with clearing active ActiveRecord connections to avoid MySql connection errors. Instead of:
In the
perform!
method in job.rb, we're firing a bunch of hooks:Get rid of these and replace with methods on the job class itself.
A common reason to have hooks is to deal with clearing active ActiveRecord connections to avoid MySql connection errors. Instead of:
Document the recommended approach as:
The text was updated successfully, but these errors were encountered: