Improved error handling and performance of escalation rebuild_all.

This commit is contained in:
Martin Edenhofer 2019-01-29 12:01:56 +01:00
parent 233198ffd6
commit 37d4abc6dd

View file

@ -16,8 +16,10 @@ returns
def self.rebuild_all
state_list_open = Ticket::State.by_category(:open)
ticket_ids = Ticket.where(state_id: state_list_open).pluck(:id)
ticket_ids = Ticket.where(state_id: state_list_open).limit(20_000).pluck(:id)
ticket_ids.each do |ticket_id|
next if !Ticket.exists?(ticket_id)
Ticket.find(ticket_id).escalation_calculation(true)
end
end