From 9f4b7a4988470297dae630cc7ade34f033fc56cb Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 18 Feb 2019 14:02:38 +0100 Subject: fewer err if one host is down --- it_cache.class | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/it_cache.class b/it_cache.class index 2186af3..bed0cd9 100644 --- a/it_cache.class +++ b/it_cache.class @@ -86,7 +86,13 @@ static function put($key, $value, $p = array()) $success = ($func = self::$_store_func) ? $func($key, $value, $p['ttl']) : null; if (!$success && $p['safety'] == 1) - it::error(['title' => ($p['distributed'] ? "memcache (" . ($memcache ? ($memcache->getResultMessage() . " on " . $memcache->getServerByKey($key)['host']) : "n/a") . ")" : self::$_store_func) . " in it_cache::put failed", 'body' => "key='$key'", 'timewindow' => "1200-1220"]); + it::error(array_filter([ + 'title' => ($p['distributed'] ? "memcache (" . ($memcache ? ($memcache->getResultMessage() . " on " . $memcache->getServerByKey($key)['host']) : "n/a") . ")" : self::$_store_func) . " in it_cache::put failed", + 'body' => "key='$key'", + 'timewindow' => "1200-1220", + 'blockmailid' => $memcache ? "memcache_on_" . $memcache->getServerByKey($key)['host'] : null, + 'blockmail' => $memcache? 12*3600 : null, + ])); $GLOBALS['it_cache_local'][$key] = $value; # Also store local copy -- cgit v1.2.3