iMacTia / lograge-sql

A Lograge extension to include SQL queries in your requests log

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query Runtime is Summed Twice

hosamaly opened this issue · comments

When config.lograge_sql.keep_default_active_record_log = true, query runtime gets summed twice: once in ActiveRecord::LogSubscriber and again in Lograge::ActiveRecordLogSubscriber.

commented

That's a great catch @hosamaly, I suspect the culprit is this line here.
The solution would be to add a condition to that so that we only sum if config.lograge_sql.keep_default_active_record_log is disabled.

Shouldn't be too hard of a change, would you like to give it a try?

I would've normally created a PR but I've got a lot on my plate at the moment. I could get back to it in a week but I hope that it will be fixed by then :)