Skip to content

Commit

Permalink
use cache_root.rmtree instead of FileUtils.rm_r cache_root, use `…
Browse files Browse the repository at this point in the history
…cache_index.delete` instead of `FileUtils.rm cache_index` and delete the gzipped version of the cache root_path file.
  • Loading branch information
f3ng3r committed Apr 23, 2012
1 parent d3ccf5c commit 3e91796
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pages/app/controllers/refinery/page_sweeper.rb
Expand Up @@ -22,12 +22,17 @@ def expire_cache

# Delete the full Cache
if (cache_root = page_cache_directory_path.join('refinery', 'cache', 'pages')).directory?
FileUtils.rm_rf cache_root
cache_root.rmtree
end

# Delete the pages index file (/refinery/cache/pages.html)
if (cache_index = page_cache_directory_path.join('refinery', 'cache', 'pages.html')).file?
FileUtils.rm_f cache_index
cache_index.delete
end

# Delete the gzipped pages index file (/refinery/cache/pages.html.gz)
if (cache_index_gz = page_cache_directory_path.join('refinery', 'cache', 'pages.html.gz')).file?
cache_index_gz.delete
end
end
end
Expand Down

0 comments on commit 3e91796

Please sign in to comment.