Support for Resque::JobWithStatus being queued via #enqueue_at and friends #127

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
5 participants

jmoses commented Dec 22, 2011

Queuing Resque::JobWithStatus jobs fail, as they fall back to the normal Resque::Job.create behavior when they are scheduled. This is because the job_hash doesn't include the :custom_job_class parameter that the config file has support for.

This change allows the jobs to set an instance variable (which isn't the best way but works) that indicates they require the custom_job_class parameter.

Support enqueued jobs that hate Resque::Job.create
Queuing Resque::JobWithStatus jobs fail, as they fall back to the normal Resque::Job.create behavior when they are scheduled.  This is because the job_hash doesn't include the :custom_job_class parameter that the config file has support for.

This change allows the jobs to set an instance variable (which isn't the best way but works) that indicates they require the custom_job_class parameter.

I would like to see this pulled as well! Thanks, @jmoses.

Owner

bvandenbos commented May 31, 2012

Any way we can avoid the instance var? Seems awkward.

Also, tap isn't in ruby 1.8.7, so this would break those unfortunate souls still using it.

jmoses commented May 31, 2012

I'll take another look at it. The instance var is awkward, but was
a "let's touch the least" fix. I'll remove the use of .tap as well.

On Wed, May 30, 2012 at 8:08 PM, Ben VandenBos
reply@reply.github.com
wrote:

Any way we can avoid the instance var?  Seems awkward.

Also, tap isn't in ruby 1.8.7, so this would break those unfortunate souls still using it.


Reply to this email directly or view it on GitHub:
bvandenbos#127 (comment)

Contributor

jonhyman commented Sep 28, 2012

I think that this pull request satisfies this: bvandenbos#182. Since custom jobs need to respond to #scheduled, it just checks for that.

Contributor

meatballhat commented Jul 25, 2013

@jmoses If there's a chance you're still interested in this, does the patch from #182 do the job? Thanks!

jmoses commented Jul 29, 2013

It looks like it does, yeah, assuming (I didn't check) the resque status jobs do "the right thing" for .scheduled, which they must, since that was the specifically mentioned usecase in the other pull.

@jmoses jmoses closed this Jul 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment