Add pruning of reports older than a week
This commit is contained in:
@@ -17,6 +17,7 @@ module DanbooruMaintenance
|
||||
safely { TagChangeRequestPruner.warn_all }
|
||||
safely { TagChangeRequestPruner.reject_all }
|
||||
safely { Ban.prune! }
|
||||
safely { ModerationReport.prune! }
|
||||
safely { CuratedPoolUpdater.update_pool! }
|
||||
safely { ActiveRecord::Base.connection.execute("vacuum analyze") unless Rails.env.test? }
|
||||
end
|
||||
|
||||
@@ -54,4 +54,8 @@ class ModerationReport < ApplicationRecord
|
||||
|
||||
q.apply_default_order(params)
|
||||
end
|
||||
|
||||
def self.prune!
|
||||
where("created_at < ?", 1.week.ago).delete_all
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user