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

ActiveJob::Plugins::Resque::Solo::Inspector.resque_present? not working #3

Closed
mike-burns opened this issue Mar 5, 2018 · 3 comments

Comments

@mike-burns
Copy link

irb(main)> ActiveJob::Base.queue_adapter
=> #<ActiveJob::QueueAdapters::ResqueAdapter:0x00001a97a023e810>
irb(main)> ActiveJob::Base.queue_adapter == ActiveJob::QueueAdapters::ResqueAdapter
=> false
irb(main)> ActiveJob::Base.queue_adapter === ActiveJob::QueueAdapters::ResqueAdapter
=> false
irb(main)> ActiveJob::Base.queue_adapter.is_a? ActiveJob::QueueAdapters::ResqueAdapter
=> true

This gem didn't just work for me (it enqueued duplicates) and I traced it back to this. When I re-opened the method to use #is_a? instead of #==, it worked (no duplicates).

@kinkade
Copy link
Owner

kinkade commented Mar 5, 2018

Thank you, @mike-burns, that's a very good suggestion to use #is_a? instead of #==. I'll write up a PR with tests to reproduce the issue and merge it in soon. Let me know if you would like attribution in the readme.

@mike-burns
Copy link
Author

No attribution needed. Thank you for looking at this!

@kinkade kinkade closed this as completed Mar 12, 2018
@kinkade
Copy link
Owner

kinkade commented Mar 12, 2018

Fixed in this commit (e01f572)

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

No branches or pull requests

2 participants