From: Michael M Slusarz Date: Fri, 17 Dec 2010 23:48:09 +0000 (-0700) Subject: Handle memcache servers that are not reachable X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7554d76ae82d2fa09e8f3b09a2d90f27759ce6e3;p=horde.git Handle memcache servers that are not reachable --- diff --git a/horde/bin/memcache_stats b/horde/bin/memcache_stats index 96d16c247..72fcfacd8 100755 --- a/horde/bin/memcache_stats +++ b/horde/bin/memcache_stats @@ -85,9 +85,17 @@ if ($all || $summary) { } } - $i = $s_count = count($stats); + $i = count($stats); + $s_count = 0; foreach ($stats as $key => $val) { + if ($val === false) { + $cli->message('Could not connect to server: ' . $key, 'cli.warning'); + continue; + } + + ++$s_count; + if ($summary) { foreach ($total_keys as $k) { $total[$k] += $val[$k]; @@ -104,8 +112,10 @@ if ($all || $summary) { } if ($summary) { - $cli->writeln($cli->green('Memcache pool (' . $s_count . ' server(s))')); - _outputInfo($total, $cli); + $cli->writeln($cli->green('Memcache pool (' . $s_count . ' active server(s))')); + if ($s_count) { + _outputInfo($total, $cli); + } } }