Subject: | forget_dead_hosts is not implemented in C:M::Fast and C:M::libmemcached |
The forget_dead_hosts() call in reset() breaks compatibility with
Cache::Memcached::Fast and Cache::Memcached::libmemcached cache
implementations. (From C:M::Fast the disconnect_all() sub is also
missing, but that will be fixed soon, I hope.)
The attached patch makes C:M::Managed to call forget_dead_hosts() only
if the cache object has such a method.
Subject: | Cache-Memcached-Managed-forget_dead_hosts-fix.diff |
diff -Naur Cache-Memcached-Managed-0.20/lib/Cache/Memcached/Managed.pm Cache-Memcached-Managed-0.20-fixed/lib/Cache/Memcached/Managed.pm
--- Cache-Memcached-Managed-0.20/lib/Cache/Memcached/Managed.pm 2008-05-19 15:41:57.000000000 +0200
+++ Cache-Memcached-Managed-0.20-fixed/lib/Cache/Memcached/Managed.pm 2008-11-19 22:55:56.000000000 +0100
@@ -762,7 +762,7 @@
foreach ($data == $directory ? ($data) : ($data,$directory)) {
$_->disconnect_all;
- $_->forget_dead_hosts; # not sure official C::Memcached API
+ $_->forget_dead_hosts if $_->can('forget_dead_hosts'); # not sure official C::Memcached API
}
# Make sure we try to connect again