Cleanup unused stats store.

This commit is contained in:
Martin Edenhofer 2015-09-08 14:11:03 +02:00
parent 692a9346fa
commit 9c4ca4b7d6

View file

@ -127,7 +127,7 @@ optional you can parse the max oldest stats store entries
=end
def self.cleanup(diff = 3.months)
StatsStore.where('created_at < ?', Time.zone.now - diff).delete_all
StatsStore.where('updated_at < ?', Time.zone.now - diff).delete_all
true
end