summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2021-01-13 13:36:17 +0100
committerUrban Müller2021-01-13 13:36:49 +0100
commit333809bea4b0ee8386db1464c90ee9a2cb95569d (patch)
tree6b94b868f3d6c5af0949d0ce89e3f9886fa40045
parent287506ebf8f4beac29bfcccb4d5cd5f4d9cc2085 (diff)
downloaditools-333809bea4b0ee8386db1464c90ee9a2cb95569d.tar.gz
itools-333809bea4b0ee8386db1464c90ee9a2cb95569d.tar.bz2
itools-333809bea4b0ee8386db1464c90ee9a2cb95569d.zip
give error keys on apc failures
-rw-r--r--it_cache.class4
1 files changed, 2 insertions, 2 deletions
diff --git a/it_cache.class b/it_cache.class
index da5114f..7c5816f 100644
--- a/it_cache.class
+++ b/it_cache.class
@@ -83,12 +83,12 @@ static function put($key, $value, $p = array())
if ($p['distributed'] && ($memcache = it_cache::_get_memcache($p)))
$success = @$memcache->set($key, $value, $p['ttl']);
else
- $success = ($func = self::$_store_func) ? $func($key, $value, $p['ttl']) : null;
+ $success = !count(($func = self::$_store_func) ? ($errors = $func([$key => $value], null, $p['ttl'])) : ['noapcu']);
if (!$success && $p['safety'] == 1)
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'",
+ 'body' => ['key' => $key, 'errors' => $errors],
'id' => $p['distributed'] ? "it_cache_fail_" . $memcache->getServerByKey($key)['host'] : "it_cache_fail",
'timewindow' => "1200-1300",
'blockmailid' => $memcache ? "memcache_on_" . $memcache->getServerByKey($key)['host'] : null,