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:
Sam
2018-01-19 08:26:18 +11:00
parent 90a8ea617b
commit 12872d03be
8 changed files with 67 additions and 33 deletions

View File

@ -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]