mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 03:09:43 +00:00
Log error for all exceptions in scheduler stats.
This commit is contained in:
parent
de25f91cd4
commit
c3b5bca0e8
@ -93,12 +93,12 @@ module Scheduler
|
||||
)
|
||||
end
|
||||
klass.new.perform
|
||||
rescue Jobs::HandledExceptionWrapper
|
||||
# Discourse.handle_exception was already called, and we don't have any extra info to give
|
||||
failed = true
|
||||
rescue => e
|
||||
Discourse.handle_job_exception(e, {message: "Running a scheduled job", job: klass})
|
||||
error = "#{e.message}: #{e.backtrace.join("\n")}"
|
||||
if e.class != Jobs::HandledExceptionWrapper
|
||||
Discourse.handle_job_exception(e, message: "Running a scheduled job", job: klass)
|
||||
end
|
||||
|
||||
error = "#{e.class}: #{e.message} #{e.backtrace.join("\n")}"
|
||||
failed = true
|
||||
end
|
||||
duration = ((Time.now.to_f - start) * 1000).to_i
|
||||
|
Loading…
x
Reference in New Issue
Block a user