Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

05/30/2012: Resque Me

Matthew Kocher
Wednesday, May 30, 2012

Helps

  • Using resque-scheduler with resque-status

We’re attempting to use both of these together, and encountered problems getting it to work.

Another project had found the answer. Resque scheduler only calls the correct method if you provide a custom_job_class in your yaml file:

This code from resque scheduler is the smoking gun:

if (job_klass = job_config['custom_job_class']) && (job_klass != 'Resque::Job')
    constantize(job_klass).scheduled(queue, klass_name, *params)
end
  • 0 Shares
  • Share on Facebook
  • Share on Twitter

5 Comments

  1. Jon says:

    There’s even a (my) pull request into resque scheduler pending and being ignored.

    https://github.com/bvandenbos/resque-scheduler/pull/127

    May 30, 2012 at 11:06 am

  2. A nicer person says:

    Quit your whining, you’re still alive.

    Work around the problem instead of blogging like a baby.

    May 30, 2012 at 4:56 pm

  3. A regular person says:

    Haha, you suck

    RTFM!

    https://github.com/bvandenbos/resque-scheduler#support-for-resque-status-and-other-custom-jobs

    May 30, 2012 at 4:57 pm

  4. Ben says:

    Hey guys,

    Yeah, admittedly, the support for custom job classes is clunky at best. I didn’t want to support it at all, but kept getting pull requests. Tried to explain it in the README, but it’s not easily discoverable. Generally, I stay away from plugins that change the job interface (ie: resque-status).

    I’ll take a look at the pull request, but it sort of feels awkward to set a var to indicate custom job. That discussion can take place on github.

    cheers,

    ben

    May 30, 2012 at 5:06 pm

  5. Matthew Kocher says:

    Thanks Ben – I think the confusions results from the naming of custom_job_class. It seems like it’s noise in the example, because your job name isn’t the name of the class. In reality, it’s what triggers calling the correct method.

    Documentation pull request incoming.

    Matthew

    May 30, 2012 at 7:43 pm

Add New Comment Cancel reply

Your email address will not be published.

Matthew Kocher

Matthew Kocher
San Francisco

Recent Posts

  • Did we git pair?
  • Service Oriented Foreman
  • Chef cookbook linting with foodcritic
Subscribe to Matthew's Feed

Author Topics

chef (5)
devops (3)
osx (1)
guiderails (1)
rails (1)
1.9.2 (1)
rvm (1)
amazon (3)
ec2 (3)
agile (3)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >