about summary refs log tree commit diff
path: root/app/models/content_retention_policy.rb
blob: b5e922c8c5fbd5716afa274f64e10232230c06c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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