Reduced times till seen online notifications are removed.

This commit is contained in:
Martin Edenhofer 2015-09-03 08:47:58 +02:00
parent 10c49976d3
commit 4be5e8493d

View file

@ -199,8 +199,8 @@ cleanup old online notifications
def self.cleanup
OnlineNotification.where('created_at < ?', Time.zone.now - 12.months).delete_all
OnlineNotification.where('seen = ? AND created_at < ?', true, Time.zone.now - 12.hours).delete_all
OnlineNotification.where('seen = ? AND updated_at < ?', true, Time.zone.now - 2.hours).delete_all
OnlineNotification.where('seen = ? AND created_at < ?', true, Time.zone.now - 4.hours).delete_all
OnlineNotification.where('seen = ? AND updated_at < ?', true, Time.zone.now - 1.hours).delete_all
# notify all agents
User.of_role('Agent').each {|user|