Improved cleanup again, reduced time to remove of old messages.

This commit is contained in:
Martin Edenhofer 2015-07-01 01:31:21 +02:00
parent a4323a7f99
commit 18a21170a2

View file

@ -126,11 +126,11 @@ cleanup old stream messages
optional you can parse the max oldest stream entries optional you can parse the max oldest stream entries
ActivityStream.cleanup(4.months) ActivityStream.cleanup(3.months)
=end =end
def self.cleanup(diff = 4.months) def self.cleanup(diff = 3.months)
ActivityStream.where('created_at < ?', Time.zone.now - diff).delete_all ActivityStream.where('created_at < ?', Time.zone.now - diff).delete_all
true true
end end