We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a771ee commit 2211451Copy full SHA for 2211451
app/jobs/application_job.rb
@@ -2,22 +2,21 @@ class ApplicationJob < ActiveJob::Base
2
attr_reader :request_id
3
4
before_enqueue do
5
- self.arguments << { request_id: Current.request_id }
+ arguments << { request_id: Current.request_id }
6
end
7
8
around_perform do |job, block|
9
@request_id = job.arguments.pop[:request_id] || ''
10
block.call
11
12
13
- around_perform :log_activejob_id
+ around_perform :log_job_metadata
14
15
def today
16
@today ||= Time.zone.now.strftime('%Y%m%d')
17
18
19
- # AP-186: Add the ActiveJob ID to job logs
20
- def log_activejob_id
+ def log_job_metadata
21
logger.with_fields = { activejob_id: job_id, request_id: @request_id }
22
yield
23
0 commit comments