E5F3 when retrieving queue name, check for 'queue_name' which is how ActiveJob defines queue names by josh-m-sharpe · Pull Request #1713 · resque/resque · GitHub
[go: up one dir, main page]

Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/resque.rb
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,9 @@ def dequeue(klass, *args)
# Given a class, try to extrapolate an appropriate queue based on a
# class instance variable or `queue` method.
def queue_from_class(klass)
(klass.instance_variable_defined?(:@queue) && klass.instance_variable_get(:@queue)) ||
(klass.respond_to?(:queue) and klass.queue)
klass.instance_variable_get(:@queue) ||
(klass.respond_to?(:queue) && klass.queue) ||
(klass.respond_to?(:queue_name) && klass.new.queue_name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add more inline documentation here about what cases these different lines are handling? Even just a link to this PR in code would be helpful.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josh-m-sharpe quick reminder here! Would love to tidy up this PR and get it merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to tidy it up and get it merged!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this, I found it useful. Has it been superseded by another solution or shall I fork/rebase and resubmit?

end

# This method will return a `Resque::Job` object or a non-true value
Expand Down
0