Printing thread stack traces is useful when diagnosing issues with slow or non-termination, and we might have one of those issues on the web site. So, refactor the thread dumping code for reuse.
11 lines
197 B
Ruby
11 lines
197 B
Ruby
# frozen_string_literal: true
|
|
|
|
module ThreadPrinter
|
|
def self.run
|
|
Thread.list.each do |thread|
|
|
puts "Thread: #{thread.inspect}"
|
|
puts thread.backtrace&.join("\n")
|
|
end
|
|
end
|
|
end
|