1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove passing extra arguments to ActiveJob Callbacks

This commit is contained in:
bogdanvlviv 2018-02-23 00:58:00 +02:00
parent f85c77bef9
commit 6a1e7292bc
No known key found for this signature in database
GPG key ID: E4ACD76A6DB6DFDD
3 changed files with 4 additions and 4 deletions

View file

@ -11,13 +11,13 @@ module ActiveJob
included do
cattr_accessor :logger, default: ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDOUT))
around_enqueue do |_, block, _|
around_enqueue do |_, block|
tag_logger do
block.call
end
end
around_perform do |job, block, _|
around_perform do |job, block|
tag_logger(job.class.name, job.job_id) do
payload = { adapter: job.class.queue_adapter, job: job }
ActiveSupport::Notifications.instrument("perform_start.active_job", payload.dup)

View file

@ -5,7 +5,7 @@ module ActiveJob
extend ActiveSupport::Concern
included do
around_perform do |job, block, _|
around_perform do |job, block|
Time.use_zone(job.timezone, &block)
end
end

View file

@ -5,7 +5,7 @@ module ActiveJob
extend ActiveSupport::Concern
included do
around_perform do |job, block, _|
around_perform do |job, block|
I18n.with_locale(job.locale, &block)
end
end