-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Allow ActiveJob::Base.set
to configure jobs when using .perform_now
#43434
Conversation
Should |
@ghiculescu I can go a few directions, do you have a preference?
|
Oh sorry I missed that |
2c11156
to
780c570
Compare
job = HelloJob.set(queue: :some_queue).perform_later | ||
assert_equal "some_queue", job.queue_name | ||
end | ||
|
||
test "uses queue passed to #set" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test removed.
job = HelloJob.set(priority: 123).perform_later | ||
assert_equal 123, job.priority | ||
end | ||
|
||
test "uses priority passed to #set" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test removed.
9243c70
to
c4fcb4e
Compare
Summary
Closes #43376, to allow
ActiveJob::Base.set
to configure jobs usingperform_now
.Extracts an instance method,
#set
(symmetrically named to the class method.set
) that extracts the configuration assignment options embedded in#enqueue
.As discussed in #43376, this behavior is necessary because:
.perform_now
job that has aretry_on
handler..perform_now
.