Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
161dd52
commit 1aa4e68
Showing
40 changed files
with
4,071 additions
and
2,922 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class TicketEscalationRebuildJob < ApplicationJob | ||
include HasActiveJobLock | ||
|
||
def perform | ||
scope.in_batches.each_record do |ticket| | ||
ticket.escalation_calculation(true) | ||
end | ||
end | ||
|
||
private | ||
|
||
def scope | ||
Ticket.where(state_id: Ticket::State.by_category(:open)) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/ | ||
module HasEscalationCalculationImpact | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
after_commit :enqueue_ticket_escalation_rebuild_job | ||
end | ||
|
||
private | ||
|
||
def enqueue_ticket_escalation_rebuild_job | ||
|
||
# return if we run import mode | ||
return if Setting.get('import_mode') && !Setting.get('import_ignore_sla') | ||
|
||
# check if condition has changed | ||
fields_to_check = if instance_of?(Sla) | ||
%w[condition calendar_id first_response_time update_time solution_time] | ||
else | ||
%w[timezone business_hours default ical_url public_holidays] | ||
end | ||
|
||
return if fields_to_check.none? do |item| | ||
next if !saved_change_to_attribute(item) | ||
|
||
saved_change_to_attribute(item)[0] != saved_change_to_attribute(item)[1] | ||
end | ||
|
||
TicketEscalationRebuildJob.perform_later | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.