aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activejob/CHANGELOG.md5
-rw-r--r--activejob/lib/active_job/logging.rb8
2 files changed, 8 insertions, 5 deletions
diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md
index 9e3c91fdfc..8526741383 100644
--- a/activejob/CHANGELOG.md
+++ b/activejob/CHANGELOG.md
@@ -1,4 +1,7 @@
-* Move `enqueue`/`enqueue_at` notifications to an around callback (was previously an after callback).
+* Move `enqueue`/`enqueue_at` notifications to an around callback.
+
+ Improves timing accuracy over the old after callback by including
+ time spent writing to the adapter's IO implementation.
*Zach Kemp*
diff --git a/activejob/lib/active_job/logging.rb b/activejob/lib/active_job/logging.rb
index d17c772f30..9ffd60ad53 100644
--- a/activejob/lib/active_job/logging.rb
+++ b/activejob/lib/active_job/logging.rb
@@ -29,11 +29,11 @@ module ActiveJob
around_enqueue do |job, block|
if job.scheduled_at
- ActiveSupport::Notifications.instrument "enqueue_at.active_job",
- adapter: job.class.queue_adapter, job: job, &block
+ ActiveSupport::Notifications.instrument("enqueue_at.active_job",
+ adapter: job.class.queue_adapter, job: job, &block)
else
- ActiveSupport::Notifications.instrument "enqueue.active_job",
- adapter: job.class.queue_adapter, job: job, &block
+ ActiveSupport::Notifications.instrument("enqueue.active_job",
+ adapter: job.class.queue_adapter, job: job, &block)
end
end
end