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.warn_all }
|
||||||
safely { TagChangeRequestPruner.reject_all }
|
safely { TagChangeRequestPruner.reject_all }
|
||||||
safely { Ban.prune! }
|
safely { Ban.prune! }
|
||||||
|
safely { ModerationReport.prune! }
|
||||||
safely { CuratedPoolUpdater.update_pool! }
|
safely { CuratedPoolUpdater.update_pool! }
|
||||||
safely { ActiveRecord::Base.connection.execute("vacuum analyze") unless Rails.env.test? }
|
safely { ActiveRecord::Base.connection.execute("vacuum analyze") unless Rails.env.test? }
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -54,4 +54,8 @@ class ModerationReport < ApplicationRecord
|
|||||||
|
|
||||||
q.apply_default_order(params)
|
q.apply_default_order(params)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.prune!
|
||||||
|
where("created_at < ?", 1.week.ago).delete_all
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user