Follow up for issue #1995 - Missing DB index on article columns queried by ticket waiting time report backend - limit the max. ticket count to 20_000 each day.

This commit is contained in:
Martin Edenhofer 2018-05-08 14:37:36 +02:00
parent 9379d7afe6
commit 6e899948c1

View file

@ -9,7 +9,7 @@ class Stats::TicketWaitingTime
own_waiting = []
all_waiting = []
Ticket.where('group_id IN (?) AND updated_at > ?', group_ids.sort, Time.zone.today).pluck(:id, :owner_id).each do |ticket|
Ticket.where('group_id IN (?) AND updated_at > ?', group_ids.sort, Time.zone.today).limit(20_000).pluck(:id, :owner_id).each do |ticket|
all_waiting.push ticket[0]
if ticket[1] == user.id
own_waiting.push ticket[0]