Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rescue for race condition in rails cache_page

  • Loading branch information...
commit 14fd6e04b57a433362bc0fa0b4df686c76b7e375 1 parent d4ab16c
@yeah yeah authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/page_cache_fu/patches.rb
View
5 lib/page_cache_fu/patches.rb
@@ -30,7 +30,10 @@ def cache_page_with_domain_and_query(content = nil, options = nil)
end
def cache_page_with_expiry(content = nil, options = nil)
- cache_page_without_expiry(content, options)
+ begin
+ cache_page_without_expiry(content, options)
+ rescue Errno::EEXIST # rescue error caused by race condition on filesystem, this should be done in Rails' ActionController::Caching::Pages::ClassMethods#cache_page
+ end
if self.class.page_cache_fu_options[params[:action].to_sym] and (expires_in = self.class.page_cache_fu_options[params[:action].to_sym][:expires_in])
expires_at = Time.now + expires_in
file = self.class.send(:page_cache_path, options)
Please sign in to comment.
Something went wrong with that request. Please try again.