Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `get_sidekiq_options' for "Worker":String #1

Closed
Darep opened this issue May 26, 2015 · 3 comments · Fixed by #2
Closed

undefined method `get_sidekiq_options' for "Worker":String #1

Darep opened this issue May 26, 2015 · 3 comments · Fixed by #2

Comments

@Darep
Copy link
Contributor

Darep commented May 26, 2015

Ran into a bug:

NoMethodError (undefined method `get_sidekiq_options' for "Worker":String):
  sidekiq/debounce.rb:48:in `debounce?'
  sidekiq/debounce.rb:9:in `call'

From Sidekiq documentation (https://github.com/mperham/sidekiq/wiki/Middleware):

Client-side middleware runs before the pushing of the job to Redis and allows you to modify/stop the job before it gets pushed. Client middleware may receive the class argument as a Class object or a String containing the name of the class.

I'll try and push a quick fix for this :) Looks like the gem should check whether worker argument is a string and constantize the class from it if it is a string.

@Darep
Copy link
Contributor Author

Darep commented May 26, 2015

I ran into more problems after fixing this. See stacktrace:

NoMethodError: undefined method `reschedule' for nil:NilClass
  from sidekiq/debounce.rb:43:in `reschedule'
  from sidekiq/debounce.rb:17:in `block in call'

conn.get(debounce_key) seems to return a hash hash-turned-into-string and reschedule cannot resolve use that as the jid:

{"class"=>"Worker", "args"=>[1155189, "update", 1], "at"=>1432629446.800971, "retry"=>true, "queue"=>"default", "debounce"=>true, "jid"=>"7dc3fdf9030a29dcccd9566c", "enqueued_at"=>1432629443.8010628}

I'm running Sidekiq 3.3.4

@NuckChorris
Copy link
Member

Now that this is fixed, I'll make a release in morning. Thanks for the patches!

@Darep
Copy link
Contributor Author

Darep commented May 28, 2015

You're welcome! 💎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants