maintenance: prune approvers monthly instead of weekly.
* Move approver pruning from a weekly task to a monthly task. * Move weekly maintenance tasks from Wednesdays at 1:30am to Sundays at midnight (UTC).
This commit is contained in:
@@ -23,10 +23,13 @@ module DanbooruMaintenance
|
|||||||
|
|
||||||
def weekly
|
def weekly
|
||||||
safely { UserPasswordResetNonce.prune! }
|
safely { UserPasswordResetNonce.prune! }
|
||||||
safely { ApproverPruner.prune! }
|
|
||||||
safely { TagRelationshipRetirementService.find_and_retire! }
|
safely { TagRelationshipRetirementService.find_and_retire! }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def monthly
|
||||||
|
safely { ApproverPruner.prune! }
|
||||||
|
end
|
||||||
|
|
||||||
def regenerate_post_counts!
|
def regenerate_post_counts!
|
||||||
updated_tags = Tag.regenerate_post_counts!
|
updated_tags = Tag.regenerate_post_counts!
|
||||||
updated_tags.each do |tag|
|
updated_tags.each do |tag|
|
||||||
|
|||||||
@@ -3,14 +3,18 @@ env "RAILS_LOG_TO_STDOUT", "true"
|
|||||||
|
|
||||||
set :output, "log/whenever.log"
|
set :output, "log/whenever.log"
|
||||||
|
|
||||||
every 1.hour do
|
every :hour do
|
||||||
rake "maintenance:hourly"
|
rake "maintenance:hourly"
|
||||||
end
|
end
|
||||||
|
|
||||||
every 1.day do
|
every :day do
|
||||||
rake "maintenance:daily"
|
rake "maintenance:daily"
|
||||||
end
|
end
|
||||||
|
|
||||||
every 1.week, :at => "1:30 am" do
|
every :sunday do
|
||||||
rake "maintenance:weekly"
|
rake "maintenance:weekly"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
every :month do
|
||||||
|
rake "maintenance:monthly"
|
||||||
|
end
|
||||||
|
|||||||
@@ -15,4 +15,9 @@ namespace :maintenance do
|
|||||||
task weekly: :environment do
|
task weekly: :environment do
|
||||||
DanbooruMaintenance.weekly
|
DanbooruMaintenance.weekly
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "Run monthly maintenance jobs"
|
||||||
|
task monthly: :environment do
|
||||||
|
DanbooruMaintenance.monthly
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user