In our fork of alaveteli we have an update to the script/clear-caches script which handles the fact that we're symbolic linking from our shared cache directory to a directory on a different filesystem. Our version of the script is:
#!/bin/bash
TOP_DIR="$(dirname "$BASH_SOURCE")/.."
pushd "$TOP_DIR"
# Clear the cache of attachment and body text.
bundle exec rails runner "ActiveRecord::Base.connection.execute(\"update incoming_messages set cached_attachment_text_clipped = null, cached_main_body_text_unfolded
= null, cached_main_body_text_folded = null, sent_at = null, subject = null, mail_from = null, mail_from_domain = null, valid_to_reply_to = null, last_parsed = nul
l\")"
cd -P cache
cd ..
TOP_DIR="$(pwd)"
# Remove page cache (do it in two stages so live site gets cache cleared faster)
rm -fr $TOP_DIR/old-cache
mv $TOP_DIR/cache $TOP_DIR/old-cache
mkdir $TOP_DIR/cache
rm -fr $TOP_DIR/old-cache
popd
We want to use the main-line version of alaveteli from the mysociety repo so we will not have this change. We will need to find an alternative way of handling this.
Either:
We never use the clear-caches script and we do things by hand (not my preferred option)
Or we rejig our file structure so that the unmodified script still works. One way we could do this is if we store everything under /srv/www in /data.
Or we try to get a change into the main alaveteli that handles the standard case and our case.
In our fork of alaveteli we have an update to the
script/clear-caches
script which handles the fact that we're symbolic linking from our shared cache directory to a directory on a different filesystem. Our version of the script is:We want to use the main-line version of alaveteli from the mysociety repo so we will not have this change. We will need to find an alternative way of handling this.
Either:
/srv/www
in/data
.