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 hooks branch you suggest to move all finders into job initialize method, and only this method will get arguments.
But you call initialize on job creation, so this will double my DB queries. Yes I can do some thing like this:
class ProcessPresentation < Qu::Job
def initialize(presentation_id)
@presentation_id = presentation_id
end
def perform
Presentation.find(@presentation_id).process!
end
end
But this looks like a hack for me.
The text was updated successfully, but these errors were encountered:
This is something that I debated in my head about for a long time and still don't feel satisfied with the solution yet. My goal was to have the job in the same state for any of the hooks. Unfortunately, as you point out, that means that it may have to do lookups for the enqueue hooks.
By passing the args to initialize, people can do whatever they want with them.
I also kicked around the idea of making the Job class act like a struct:
Hi.
In hooks branch you suggest to move all finders into job initialize method, and only this method will get arguments.
But you call initialize on job creation, so this will double my DB queries. Yes I can do some thing like this:
But this looks like a hack for me.
The text was updated successfully, but these errors were encountered: