Fix broken lograge logs.

This commit is contained in:
Guo Xiang Tan 2017-11-28 14:00:13 +08:00
parent df84e1c358
commit 46f8a6c97d
1 changed files with 11 additions and 4 deletions

View File

@ -21,11 +21,18 @@ if (Rails.env.production? && SiteSetting.logging_provider == 'lograge') || ENV["
if data = Thread.current[:_method_profiler]
sql = data[:sql]
output[:db] = sql[:duration] * 1000
output[:db_calls] = sql[:calls]
if sql
output[:db] = sql[:duration] * 1000
output[:db_calls] = sql[:calls]
end
redis = data[:redis]
output[:redis] = redis[:duration] * 1000
output[:redis_calls] = redis[:calls]
if redis
output[:redis] = redis[:duration] * 1000
output[:redis_calls] = redis[:calls]
end
end
output