From ca0a25e8480b70df77b521dedd56dc847569e46b Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 19 Jun 2013 14:23:04 +0200 Subject: [PATCH] Reset event buffer after list. --- app/models/observer/ticket/notification.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/models/observer/ticket/notification.rb b/app/models/observer/ticket/notification.rb index dc53f7701..69ded6f6d 100644 --- a/app/models/observer/ticket/notification.rb +++ b/app/models/observer/ticket/notification.rb @@ -11,7 +11,13 @@ class Observer::Ticket::Notification < ActiveRecord::Observer # return if we run import mode return if Setting.get('import_mode') - EventBuffer.list.each { |event| + # get buffer + list = EventBuffer.list + + # reset buffer + EventBuffer.reset + + list.each { |event| # get current state of objects if event[:name] == 'Ticket::Article' @@ -158,9 +164,6 @@ class Observer::Ticket::Notification < ActiveRecord::Observer end end } - - # reset buffer - EventBuffer.reset end def self.send_notify(data, ticket, article)