Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve robustness of Page#expire_page_caching for both ActiveSupport…

…::Cache::FileStore and ActiveSupport::Cache::MemoryStore
  • Loading branch information...
commit d1f56ae5f3ae697bafadeb3eb0ae2a3e7f0aac41 1 parent 4562f4d
@zenchicken zenchicken authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 pages/app/models/page.rb
View
6 pages/app/models/page.rb
@@ -262,8 +262,10 @@ def use_marketable_urls?
end
def expire_page_caching
- if File.writable?(Rails.cache.cache_path)
- Pathname.glob(File.join(Rails.cache.cache_path, '**', '*pages*')).each(&:delete)
+ begin
+ Rails.cache.delete_matched(/.*pages.*/)
+ rescue NotImplementedError
+ # TODO Inform user that cache backing store can't help us here ...
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.