aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--conf/general.yml-example4
-rw-r--r--perllib/Memcached.pm3
3 files changed, 7 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e9cba54b8..f24b917e1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@
- Cobrand hook for disabling updates on individual problems.
- Cobrand hook for disallowing title moderation. #2228
- Cobrand hook for per-questionnaire sending. #2231
+ - Add option for configuring memcache server.
* v2.4 (6th September 2018)
- Security
diff --git a/conf/general.yml-example b/conf/general.yml-example
index 9f1e2a01d..1f85b6fe7 100644
--- a/conf/general.yml-example
+++ b/conf/general.yml-example
@@ -197,6 +197,10 @@ SMTP_PASSWORD: ''
# this as is.
GAZE_URL: 'https://gaze.mysociety.org/gaze'
+# Memcached host
+# This can be safely left out and will default to '127.0.0.1' even if not present.
+MEMCACHED_HOST: '127.0.0.1'
+
# Should problem reports link to the council summary pages?
AREA_LINKS_FROM_PROBLEMS: '0'
diff --git a/perllib/Memcached.pm b/perllib/Memcached.pm
index 63f22a645..05ceeb615 100644
--- a/perllib/Memcached.pm
+++ b/perllib/Memcached.pm
@@ -10,10 +10,11 @@ use FixMyStreet;
my $memcache;
my $namespace = FixMyStreet->config('FMS_DB_NAME') . ":";
+my $server = FixMyStreet->config('MEMCACHED_HOST') || '127.0.0.1';
sub instance {
return $memcache //= Cache::Memcached->new({
- 'servers' => [ '127.0.0.1:11211' ],
+ 'servers' => [ "${server}:11211" ],
'namespace' => $namespace,
'debug' => 0,
'compress_threshold' => 10_000,