add class for pruning metatags
This commit is contained in:
@@ -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)
|
||||
|
||||
7
app/logical/tag_pruner.rb
Normal file
7
app/logical/tag_pruner.rb
Normal 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
|
||||
Reference in New Issue
Block a user