content_retention_policy.rb 499 B

12345678910111213141516171819202122232425
  1. # frozen_string_literal: true
  2. class ContentRetentionPolicy
  3. def self.current
  4. new
  5. end
  6. def media_cache_retention_period
  7. retention_period Setting.media_cache_retention_period
  8. end
  9. def content_cache_retention_period
  10. retention_period Setting.content_cache_retention_period
  11. end
  12. def backups_retention_period
  13. retention_period Setting.backups_retention_period
  14. end
  15. private
  16. def retention_period(value)
  17. value.days if value.is_a?(Integer) && value.positive?
  18. end
  19. end