Cleanup unused stats store.
This commit is contained in:
parent
692a9346fa
commit
9c4ca4b7d6
|
@ -127,7 +127,7 @@ optional you can parse the max oldest stats store entries
|
||||||
=end
|
=end
|
||||||
|
|
||||||
def self.cleanup(diff = 3.months)
|
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
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue