Add retention policy for cached content and media (#19232)
This commit is contained in:
parent
3e0999cd11
commit
5c9abdeff1
30 changed files with 559 additions and 135 deletions
25
app/models/content_retention_policy.rb
Normal file
25
app/models/content_retention_policy.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ContentRetentionPolicy
|
||||
def self.current
|
||||
new
|
||||
end
|
||||
|
||||
def media_cache_retention_period
|
||||
retention_period Setting.media_cache_retention_period
|
||||
end
|
||||
|
||||
def content_cache_retention_period
|
||||
retention_period Setting.content_cache_retention_period
|
||||
end
|
||||
|
||||
def backups_retention_period
|
||||
retention_period Setting.backups_retention_period
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def retention_period(value)
|
||||
value.days if value.is_a?(Integer) && value.positive?
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue