Reduce lifetime of online notfications.

This commit is contained in:
Martin Edenhofer 2015-09-03 11:16:07 +02:00
parent e2dff052a5
commit c4037be94c

View file

@ -188,7 +188,7 @@ cleanup old online notifications
=end
def self.cleanup
OnlineNotification.where('created_at < ?', Time.zone.now - 12.months).delete_all
OnlineNotification.where('created_at < ?', Time.zone.now - 6.months).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