Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/119' into develop, Forward port #119
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-mabe committed Nov 4, 2016
2 parents c4c11ed + 2d46e73 commit 47315eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,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)
Expand Down
10 changes: 7 additions & 3 deletions src/Storage/Adapter/RedisResourceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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'];
}

Expand Down

0 comments on commit 47315eb

Please sign in to comment.