aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache/file_store.rb
diff options
context:
space:
mode:
authorPhilippe Huibonhoa <phuibonhoa@gmail.com>2011-09-29 18:59:40 -0700
committerPhilippe Huibonhoa <phuibonhoa@gmail.com>2011-09-29 18:59:40 -0700
commit0baa8f8604e7766ce627120dfe572e09c247ef8c (patch)
tree30ddc6e35037a6e1da75c6856cb8cab6a80e5072 /activesupport/lib/active_support/cache/file_store.rb
parentd2888de5985c7018a5be23d44143ec3c6cef9032 (diff)
downloadrails-0baa8f8604e7766ce627120dfe572e09c247ef8c.tar.gz
rails-0baa8f8604e7766ce627120dfe572e09c247ef8c.tar.bz2
rails-0baa8f8604e7766ce627120dfe572e09c247ef8c.zip
Added fix so that file store does not raise an exception when cache dir does not exist yet. This can happen if a delete_matched is called before anything is saved in the cache.
Diffstat (limited to 'activesupport/lib/active_support/cache/file_store.rb')
-rw-r--r--activesupport/lib/active_support/cache/file_store.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb
index 3f516d4808..b431041b76 100644
--- a/activesupport/lib/active_support/cache/file_store.rb
+++ b/activesupport/lib/active_support/cache/file_store.rb
@@ -161,6 +161,7 @@ module ActiveSupport
end
def search_dir(dir, &callback)
+ return if !File.exist?(dir)
Dir.foreach(dir) do |d|
next if d == "." || d == ".."
name = File.join(dir, d)