mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 02:41:13 +08:00
FIX: avoid usage of dig when looking for job class (#17772)
`{a: "a"}.dig(:a, :b)` will result in an exception, since ruby assumes that `"a"` will be another hash it can look up the `:b` key on.
This commit is contained in:
@ -175,9 +175,13 @@ module Discourse
|
||||
context ||= {}
|
||||
parent_logger ||= Sidekiq
|
||||
|
||||
job = context.dig(:job, "class")
|
||||
if job
|
||||
job_exception_stats[job] += 1
|
||||
job = context[:job]
|
||||
|
||||
if Hash === job
|
||||
job_class = job["class"]
|
||||
if job_class
|
||||
job_exception_stats[job_class] += 1
|
||||
end
|
||||
end
|
||||
|
||||
cm = RailsMultisite::ConnectionManagement
|
||||
|
Reference in New Issue
Block a user