From a7ca3ee58893f10a52be460076973ac76b8c74c7 Mon Sep 17 00:00:00 2001 From: Moln Date: Thu, 27 Oct 2016 12:03:14 +0800 Subject: [PATCH 1/2] 1. We don't need call info method every time we want redis resource. +1 --- src/Storage/Adapter/RedisResourceManager.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Storage/Adapter/RedisResourceManager.php b/src/Storage/Adapter/RedisResourceManager.php index fa2ddd616..038dfc24e 100644 --- a/src/Storage/Adapter/RedisResourceManager.php +++ b/src/Storage/Adapter/RedisResourceManager.php @@ -118,7 +118,7 @@ public function getPassword($id) * Gets a redis resource * * @param string $id - * @return RedisResourceManager + * @return RedisResource * @throws Exception\RuntimeException */ public function getResource($id) @@ -133,8 +133,12 @@ public function getResource($id) if (!$resource['initialized']) { $this->connect($resource); } - $info = $resource['resource']->info(); - $resource['version'] = $info['redis_version']; + + if (!$resource['version']) { + $info = $resource['resource']->info(); + $resource['version'] = $info['redis_version']; + } + return $resource['resource']; } From 2d46e73ca7a72740c0dc4edd20edebe0887300bb Mon Sep 17 00:00:00 2001 From: Marc Bennewitz Date: Fri, 4 Nov 2016 22:16:36 +0100 Subject: [PATCH 2/2] Added #119 to CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6740fd68..e1515115d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed +- [#119](https://github.com/zendframework/zend-cache/pull/119) + Redis: Don't call method Redis::info() every time - [#113](https://github.com/zendframework/zend-cache/pull/113) Travis: Moved coverage reporting to latest env - [#114](https://github.com/zendframework/zend-cache/pull/114)