mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
PERF: run post timings in background
This means that if a very large amount of registered users hit a single topic we will handle it gracefully, even if db gets slow.
This commit is contained in:
@ -37,6 +37,10 @@ class MethodProfiler
|
||||
}
|
||||
end
|
||||
|
||||
def self.clear
|
||||
Thread.current[:_method_profiler] = nil
|
||||
end
|
||||
|
||||
def self.stop
|
||||
finish = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
||||
if data = Thread.current[:_method_profiler]
|
||||
|
Reference in New Issue
Block a user