enova / sidekiq-rate-limiter

Redis-backed, per-worker rate limits for job processing.
http://rubygems.org/gems/sidekiq-rate-limiter
MIT License
193 stars 43 forks source link

Workers on named queue won't execute #1

Closed moxley closed 10 years ago

moxley commented 10 years ago

I configured my worker like so:

sidekiq_options rate: { limit: 1, period: 2.seconds }

...And it executes fine in the default queue. However, if a queue name is added to this configuration:

sidekiq_options queue: 'myqueue', rate: { limit: 1, period: 2.seconds }

... the messages just sit there in the named queue, and Sidekiq doesn't execute them.

I also tried adding queues in sidekiq.yml, like so:

:queues:
  - default
  - myqueue

Any ideas? Thanks!

bwthomas commented 10 years ago

What version of redis & sidekiq are you using?

My first reaction was to look at the string vs. symbol issue, maybe I forgot to account for that, but that doesn't seem to be it. When fetch pulls the work from redis it's in JSON, & I parse that json to pull the options. It occurred to me, however, that for different versions of redis and/or sidekiq they might come back differently. That also seems unlikely, because JSON. So the only thing I can think to do is to try to replicate your issue & debug from there.

Alternatively, the code in sidekiq-rate-limiter is fairly straight-forward, if you can spot a possible culprit I'm all ears.

moxley commented 10 years ago

Sorry, this is actually not an issue with sidekiq-rate-limiter. It was the fact that I didn't tell Sidekiq about the config file. The Sidekiq wiki was pretty sparse around the configuration file. Now fixed. Thanks for reply.

bwthomas commented 10 years ago

Yeah, no problem. Glad someone's using it.