diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/application.rb | 10 |
2 files changed, 13 insertions, 3 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 32882f8a4..7f8cfbd67 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: admin_controller.rb,v 1.28 2009-09-15 20:46:35 francis Exp $ +# $Id: admin_controller.rb,v 1.29 2009-09-17 10:24:35 francis Exp $ require 'fileutils' @@ -34,6 +34,10 @@ class AdminController < ApplicationController cache_subpath = File.join(self.cache_store.cache_path, "views/request/#{info_request.id}") FileUtils.rm_rf(cache_subpath) + # Remove the database caches of body / attachment text (the attachment text + # one is after privacy rules are applied) + info_request.clear_in_database_caches! + # also force a search reindexing (so changed text reflected in search) info_request.reindex_request_events end diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 8c4410b65..0d3664d4d 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -6,15 +6,21 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: application.rb,v 1.57 2009-09-15 11:47:20 francis Exp $ +# $Id: application.rb,v 1.58 2009-09-17 10:24:35 francis Exp $ class ApplicationController < ActionController::Base # Standard headers, footers and navigation for whole site layout "default" - # Help work out which request causes RAM spike + # Help work out which request causes RAM spike. # http://www.codeweblog.com/rails-to-monitor-the-process-of-memory-leaks-skills/ + # This shows the memory use increase of the Ruby process due to the request. + # Since Ruby never returns memory to the OS, if the existing process previously + # served a larger request, this won't show any consumption for the later request. + # Ruby also grabs memory from the OS in variously sized jumps, so the extra + # consumption of a request shown by this function will only appear in such + # jumps. around_filter :record_memory def record_memory File.read("/proc/#{Process.pid}/status").match(/VmRSS:\s+(\d+)/) |