mirror of
https://github.com/mastodon/mastodon.git
synced 2026-04-24 23:29:30 -05:00
Change wrapstodon to be disabled if posts older than 6 months get automatically cleaned
This commit is contained in:
parent
f840d7bf9f
commit
03c22ebe10
|
|
@ -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) }
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user