add class for pruning metatags

This commit is contained in:
albert
2013-03-18 22:36:21 -07:00
parent 95ac6c7762
commit 1cbe07668a
3 changed files with 13 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
class DailyMaintenance
def run
PostPruner.new.prune!
TagPruner.new.prune!
Upload.delete_all(['created_at < ?', 1.day.ago])
ModAction.delete_all(['created_at < ?', 3.days.ago])
Delayed::Job.delete_all(['created_at < ?'], 1.day.ago)

View File

@@ -0,0 +1,7 @@
class TagPruner
def prune!
Tag.without_timeout do
Tag.destroy_all(["post_count <= 0 and name like '%:%'"])
end
end
end