Skip to content

rake que:work doesn't process jobs at v0.8.0 when Que.mode = :off #50

@timriley

Description

@timriley

Hi there,

We use Que with Que.mode = :off so that we can process jobs in a dedicated worker process, via the rake que:work task. After upgrading to v0.8.0, this has stopped processing jobs for us.

I've reproduced this issue in a vanilla Rails 4.1 app. The steps I took were:

  1. rails new test_que

  2. Added gem "que" to the Gemfile and ran bundle

  3. Added config/initializers/que.rb with Que.mode = :off as the only content

  4. Added a tiny job class to test with, such as:

    class TestJob < Que::Job
      def run
        puts "I'm done!"
      end
    end
  5. Ran rake que:work

  6. Over in another terminal tab, opened rails console and entered TestJob.enqueue

  7. Back in the tab with the rake task, I watch the output and see nothing new about processing that TestJob.

If I do all of these steps with gem "que", "0.7.3" in my Gemfile, then everything works. I run TestJob.enqueue and output about processing the job immediately appears in the shell running the rake que:work task.

Looking over your changes in v0.8.0, it looks like this might be the cause of the issue. It looks like the code for the worker to actually process the jobs only ever gets activated if Que.mode = :async. This would be fine if you wanted Que in :async mode, but when you want it :off, to allow the dedicated worker process, it seems like nothing ever happens.

Am I understanding all of this right? Would a fix be to change that conditional to check for either :async or :off as the Que mode? Anyway, I hope this is enough information for you to look into the issue. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions