Change wrapstodon to be disabled if posts older than 6 months get automatically cleaned

This commit is contained in:
Claire 2026-01-09 11:56:54 +01:00
parent f840d7bf9f
commit 03c22ebe10

View File

@ -30,7 +30,7 @@ class AnnualReport
def eligible?
with_read_replica do
SOURCES.all? { |klass| klass.new(@account, @year).eligible? }
sufficient_post_retention? && SOURCES.all? { |klass| klass.new(@account, @year).eligible? }
end
end
@ -67,6 +67,10 @@ class AnnualReport
private
def sufficient_post_retention?
@account.statuses_cleanup_policy.nil? || @account.statuses_cleanup_policy.min_status_age > 6.months.seconds
end
def data
with_read_replica do
SOURCES.each_with_object({}) { |klass, hsh| hsh.merge!(klass.new(@account, @year).generate) }