contribsys / faktory_worker_ruby

Faktory worker for Ruby
GNU Lesser General Public License v3.0
214 stars 31 forks source link

Worker only checking default channel? #37

Closed wjsetzer closed 5 years ago

wjsetzer commented 5 years ago

I have a worker defined in a file workers.rb:

class ChannelWorker
  include Faktory::Job

  faktory_options queue: 'channels', queues:['channels'], retry: 25, backtrace: 0

  def perform(username)
  ...
  end
end

I am trying to get this worker to pull work from the channels queue. While ChannelWorker.perform_async channel puts work into the channels queue, when running the worker, it does not get the work from the queue.

When removing the faktory_options line, the worker runs like normal, but only on the default queue, which I am trying to avoid so that I can have a queue per job type.

I checked the options that the worker currently has with ChannelWorker.get_faktory_options, which returns {"retry"=>25, "queue"=>"channels", "queues"=>["channels"], "backtrace"=>0}, leading me to believe that it should be pulling from the queue.

jagthedrummer commented 5 years ago

I think you need to tell faktory-worker what queues to work on with something like:

bundle exec faktory-worker -q channels
wjsetzer commented 5 years ago

Oh wow, thank you. I couldn't find this in the docs anywhere, which may just be me not looking in the right place.