only cancel recent duplicate pending messages
a created_at scope will limit the search at most two partitions closes #CORE-2381 Change-Id: I4893eaad14198385e88dc7455200198eac550e24 Reviewed-on: https://gerrit.instructure.com/178647 Reviewed-by: Rob Orton <rob@instructure.com> QA-Review: Rob Orton <rob@instructure.com> Product-Review: Rob Orton <rob@instructure.com> Tested-by: Rob Orton <rob@instructure.com>
This commit is contained in:
parent
0b31194649
commit
e39e27ae40
|
@ -297,6 +297,7 @@ class NotificationMessageCreator
|
|||
by_name(@notification.name).
|
||||
for_user(@to_users + @to_channels).
|
||||
cancellable.
|
||||
where("created_at BETWEEN ? AND ?", Setting.get("pending_duplicate_message_window_hours", "6").to_i.hours.ago, Time.now.utc).
|
||||
update_all(:workflow_state => 'cancelled')
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue