提交 e2dbfe5a 编写于 作者: E Erich Soares Machado

Fixes ActiveSupport::Cache::FileStore#cleanup bug which prevented it from...

Fixes ActiveSupport::Cache::FileStore#cleanup bug which prevented it from cleaning up the expired cache keys
上级 012196bb
......@@ -39,9 +39,8 @@ def clear(options = nil)
def cleanup(options = nil)
options = merged_options(options)
search_dir(cache_path) do |fname|
key = file_path_key(fname)
entry = read_entry(key, options)
delete_entry(key, options) if entry && entry.expired?
entry = read_entry(fname, options)
delete_entry(fname, options) if entry && entry.expired?
end
end
......
......@@ -118,6 +118,7 @@ def test_cleanup_removes_all_expired_entries
assert_not @cache.exist?("foo")
assert @cache.exist?("baz")
assert @cache.exist?("quux")
assert_equal 2, Dir.glob(File.join(cache_dir, "**")).size
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册