Use config_for
for cache buster values (#34851)
This commit is contained in:
parent
9860046b04
commit
c025824f98
9 changed files with 13 additions and 19 deletions
|
@ -417,7 +417,7 @@ class MediaAttachment < ApplicationRecord
|
|||
|
||||
# Record the cache keys to burst before the file get actually deleted
|
||||
def prepare_cache_bust!
|
||||
return unless Rails.configuration.x.cache_buster_enabled
|
||||
return unless Rails.configuration.x.cache_buster.enabled
|
||||
|
||||
@paths_to_cache_bust = MediaAttachment.attachment_definitions.keys.flat_map do |attachment_name|
|
||||
attachment = public_send(attachment_name)
|
||||
|
@ -434,7 +434,7 @@ class MediaAttachment < ApplicationRecord
|
|||
# Once Paperclip has deleted the files, we can't recover the cache keys,
|
||||
# so use the previously-saved ones
|
||||
def bust_cache!
|
||||
return unless Rails.configuration.x.cache_buster_enabled
|
||||
return unless Rails.configuration.x.cache_buster.enabled
|
||||
|
||||
CacheBusterWorker.push_bulk(@paths_to_cache_bust) { |path| [path] }
|
||||
rescue => e
|
||||
|
|
|
@ -95,7 +95,7 @@ class SuspendAccountService < BaseService
|
|||
end
|
||||
end
|
||||
|
||||
CacheBusterWorker.perform_async(attachment.url(style)) if Rails.configuration.x.cache_buster_enabled
|
||||
CacheBusterWorker.perform_async(attachment.url(style)) if Rails.configuration.x.cache_buster.enabled
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -91,7 +91,7 @@ class UnsuspendAccountService < BaseService
|
|||
end
|
||||
end
|
||||
|
||||
CacheBusterWorker.perform_async(attachment.url(style)) if Rails.configuration.x.cache_buster_enabled
|
||||
CacheBusterWorker.perform_async(attachment.url(style)) if Rails.configuration.x.cache_buster.enabled
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue