Performance improvement for follow up detection.
This commit is contained in:
parent
86430e9e33
commit
d17906f333
2 changed files with 4 additions and 3 deletions
|
@ -112,8 +112,6 @@ module Channel::Filter::IdentifySender
|
||||||
display_name = nil
|
display_name = nil
|
||||||
if recipient =~ /.*<(.+?)>/
|
if recipient =~ /.*<(.+?)>/
|
||||||
address = $1
|
address = $1
|
||||||
elsif recipient =~ /<(.+?)>/
|
|
||||||
address = $1
|
|
||||||
end
|
end
|
||||||
if recipient =~ /^(.+?)<(.+?)>/
|
if recipient =~ /^(.+?)<(.+?)>/
|
||||||
display_name = $1
|
display_name = $1
|
||||||
|
|
|
@ -47,7 +47,10 @@ class Channel::Filter::MonitoringBase
|
||||||
|
|
||||||
# follow up detection by meta data
|
# follow up detection by meta data
|
||||||
open_states = Ticket::State.by_category(:open)
|
open_states = Ticket::State.by_category(:open)
|
||||||
Ticket.where(state: open_states).each { |ticket|
|
ticket_ids = Ticket.where(state: open_states).order(created_at: :desc).limit(5000).pluck(:id)
|
||||||
|
ticket_ids.each { |ticket_id|
|
||||||
|
ticket = Ticket.find_by(id: ticket_id)
|
||||||
|
next if !ticket
|
||||||
next if !ticket.preferences
|
next if !ticket.preferences
|
||||||
next if !ticket.preferences['integration']
|
next if !ticket.preferences['integration']
|
||||||
next if ticket.preferences['integration'] != integration
|
next if ticket.preferences['integration'] != integration
|
||||||
|
|
Loading…
Reference in a new issue