ticket_escalation_rebuild_job.rb 366 B

123456789101112131415161718
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class TicketEscalationRebuildJob < ApplicationJob
  3. include HasActiveJobLock
  4. def perform
  5. scope.in_batches.each_record do |ticket|
  6. ticket.escalation_calculation(true)
  7. end
  8. end
  9. private
  10. def scope
  11. Ticket.where(state_id: Ticket::State.by_category(:open))
  12. end
  13. end