/** * {@inheritDoc} */ protected function _execute(\Closure $action, $operation, $key_or_keys, $mutable = false, $value = null) { $result = parent::_execute($action, $operation, $key_or_keys, $mutable, $value); // Adapter connection itself will only report correctly when not currently buffering results if (!$this->isBuffering()) { $code = $this->_connection->getResultCode(); if ($code !== \Memcached::RES_SUCCESS) { $this->_handleFailure($this->_connection->getResultMessage(), null, null, $code); } } // if !isBuffering return $result; }
/** * {@inheritDoc} * * @link https://github.com/phpredis/phpredis#class-redisexception */ protected function _execute(\Closure $action, $operation, $key_or_keys, $mutable = false, $value = null) { // Redis may throw an exception for any connectivity error, unlike memcache and memcached. Suppress exception, log, and return false $protected_action = function () use($action) { try { return $action(); } catch (\RedisException $e) { $this->_handleFailure($e->getMessage(), null, null, $e->getCode()); return false; } }; // protected_action return parent::_execute($protected_action, $operation, $key_or_keys, $mutable, $value); }