cache_clear_job.rb 424 B

1234567891011121314
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class CacheClearJob < ApplicationJob
  3. include HasActiveJobLock
  4. def perform
  5. # Memcached does not support clean-up, so only perform it for filesystem cache.
  6. return if !Rails.cache.is_a? ActiveSupport::Cache::FileStore
  7. Rails.cache.cleanup
  8. rescue => e
  9. Rails.logger.error "Scheduled cache cleanup failed! #{e.inspect}"
  10. end
  11. end