From 7de3281ccedcd22c024f6734c6e1f449e1d50fb7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 23 Jun 2016 09:33:02 +0100 Subject: [PATCH] Bug XXXXX_1: Fix support of several memcached servers There is a bug in the initialisation of memcached, the server string is not correctly parsed. If several memcached servers are defined, they are separated by commas and so the string should be split accordingly Test plan: 1/ Set MEMCACHED_SERVERS='localhost:11211,localhost:11222' 2/ Set DEBUG=1 3/ Reload plack, and check the log => Without this patch, you see Memcached server settings: localhost:11211,localhost:11222 with koha Selected caching system: Cache::Memory=HASH(0x9de2034) i.e. Memcached has not been configured correctly and the default caching system is used (Cache::Memory) => With this patch, you should see Memcached server settings: localhost:11211, localhost:11222 with koha Selected caching system: Cache::Memcached::Fast=SCALAR(0xa2a0c54) i.e. Memcached has been configured correctly \o/ Note that the cache_servers attribute is never set and it not used. It's better to remove it. https://bugs.koha-community.org/show_bug.cgi?id=16579 --- Koha/Cache.pm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Koha/Cache.pm b/Koha/Cache.pm index fa4f136..34c793f 100644 --- a/Koha/Cache.pm +++ b/Koha/Cache.pm @@ -122,10 +122,7 @@ sub new { sub _initialize_memcached { my ($self) = @_; - my @servers = - split /,/, $self->{'cache_servers'} - ? $self->{'cache_servers'} - : ($ENV{MEMCACHED_SERVERS} || ''); + my @servers = split /,/, $ENV{MEMCACHED_SERVERS} || ''; return if !@servers; $ENV{DEBUG} -- 2.8.1