FIX: slow_query is now happening in report.rb directly
This commit is contained in:
parent
9274124de6
commit
82e1e53432
16
plugin.rb
16
plugin.rb
|
@ -277,18 +277,10 @@ after_initialize do
|
||||||
|
|
||||||
values = []
|
values = []
|
||||||
|
|
||||||
timeout = wrap_slow_query do
|
values = PluginStoreRow.where(plugin_name: 'staff_notes')
|
||||||
values = PluginStoreRow.where(plugin_name: 'staff_notes')
|
.where("value::json->0->>'created_at'>?", report.start_date)
|
||||||
.where("value::json->0->>'created_at'>?", report.start_date)
|
.where("value::json->0->>'created_at'<?", report.end_date)
|
||||||
.where("value::json->0->>'created_at'<?", report.end_date)
|
.pluck(:value)
|
||||||
.pluck(:value)
|
|
||||||
end
|
|
||||||
|
|
||||||
if Object.const_defined?("Report::SCHEMA_VERSION")
|
|
||||||
report.error = timeout
|
|
||||||
else
|
|
||||||
report.timeout = timeout
|
|
||||||
end
|
|
||||||
|
|
||||||
values.each do |value|
|
values.each do |value|
|
||||||
data = {}
|
data = {}
|
||||||
|
|
Loading…
Reference in New Issue