FIX: slow_query is now happening in report.rb directly

This commit is contained in:
Joffrey JAFFEUX 2018-08-01 09:54:22 -04:00
parent 9274124de6
commit 82e1e53432
1 changed files with 4 additions and 12 deletions

View File

@ -277,18 +277,10 @@ after_initialize do
values = []
timeout = wrap_slow_query do
values = PluginStoreRow.where(plugin_name: 'staff_notes')
.where("value::json->0->>'created_at'>?", report.start_date)
.where("value::json->0->>'created_at'<?", report.end_date)
.pluck(:value)
end
if Object.const_defined?("Report::SCHEMA_VERSION")
report.error = timeout
else
report.timeout = timeout
end
values = PluginStoreRow.where(plugin_name: 'staff_notes')
.where("value::json->0->>'created_at'>?", report.start_date)
.where("value::json->0->>'created_at'<?", report.end_date)
.pluck(:value)
values.each do |value|
data = {}