@@ -, +, @@ _initilize_memcached() on the second time it is invoked --- Koha/Cache.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) --- a/Koha/Cache.pm +++ a/Koha/Cache.pm @@ -146,9 +146,21 @@ sub _initialize_memcached { utf8 => 1, } ); + # Ensure we can actually talk to the memcached server my $ismemcached = $memcached->set('ismemcached','1'); - return $self unless $ismemcached; + if (defined($ismemcached)) { #If value is defined, memcached is alive + if ($ismemcached) { #Value is true so operation succeeded + #Ok + } + else { #Value is False, but still defined, so the 'ismemcached'-key already exists. + #Ok, while nothing happened + } + } + else { #Value is undefined, so there was an error with the server, or the connection to it + warn "Connection to the memcached servers '@servers' failed. Are the unix socket permissions set properly? Is the host reachable?"; + return $self; + } $self->{'memcached_cache'} = $memcached; return $self; } --