8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/rails_cloud_tasks/rack/jobs.rb', line 8
def call(env)
job_class = (env)
RailsCloudTasks::Instrumentation.transaction_name!(
"RailsCloudTasks/#{job_class}/perform_now"
)
request = ::Rack::Request.new(env)
job_args = (request)
RailsCloudTasks::Instrumentation.add_custom_attributes(
{ request_body: job_args }
)
job_class.perform_now(*job_args)
response(200, {})
rescue Rack::InvalidPayloadError => e
response(422, { error: e.message })
end
|