aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/admin_controller.rb
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-07-13 23:54:46 +0100
committerFrancis Irving <francis@mysociety.org>2010-07-13 23:54:46 +0100
commit59395b3bdf19aed7bf5f77656afa6c31dad7e138 (patch)
treeb6e4c9f9e5b4a9f792a550ce3af727ae32b1cba1 /app/controllers/admin_controller.rb
parent452ac41f05f655a9fd23c8df4796f26632c23050 (diff)
parentda2c0aaf5f0d07baa3a355033a92d5dd295f2f13 (diff)
Merge branch 'master' into francis-profile-photo
Conflicts: app/views/user/show.rhtml commonlib spec/controllers/user_controller_spec.rb
Diffstat (limited to 'app/controllers/admin_controller.rb')
-rw-r--r--app/controllers/admin_controller.rb16
1 files changed, 3 insertions, 13 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 7f8cfbd67..ca5538e03 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -19,19 +19,9 @@ class AdminController < ApplicationController
# Expire cached attachment files for a request
def expire_for_request(info_request)
- # Clear out cached entries - use low level disk removal, even though we
- # are clearing results from caches_action, for several reasons:
- # * We can't use expire_action here, as it doesn't seem to be
- # compatible with the :only_path we used in the caches_action
- # call.
- # * Removing everything is simpler than having to get all the
- # parameters right for the path, and calling for HTML version vs. raw
- # attachment version.
- # * We cope properly with filenames changed by censor rules, which
- # change the URL.
- # * We could use expire_fragment with a Regexp, but it walks the whole
- # cache which is insanely slow
- cache_subpath = File.join(self.cache_store.cache_path, "views/request/#{info_request.id}")
+ # Clear out cached entries, by removing files from disk (the built in
+ # Rails fragment cache made doing this and other things too hard)
+ cache_subpath = foi_fragment_cache_all_for_request(info_request)
FileUtils.rm_rf(cache_subpath)
# Remove the database caches of body / attachment text (the attachment text