aboutsummaryrefslogtreecommitdiffstats
path: root/script/clear-caches
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 /script/clear-caches
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 'script/clear-caches')
-rwxr-xr-xscript/clear-caches13
1 files changed, 13 insertions, 0 deletions
diff --git a/script/clear-caches b/script/clear-caches
new file mode 100755
index 000000000..01ea95edc
--- /dev/null
+++ b/script/clear-caches
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# Clear the cache of attachment and body text.
+
+LOC=`dirname $0`
+
+$LOC/runner "ActiveRecord::Base.connection.execute(\"update incoming_messages set cached_attachment_text_clipped = null, cached_main_body_text = null\")"
+
+# Remove page cache (do it in two stages so live site gets cache cleared faster)
+rm -fr $LOC/../old-cache
+mv $LOC/../cache $LOC/../old-cache
+rm -fr $LOC/../old-cache
+