Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Commit

Permalink
Merge pull request #89 from rdohms/feature/allow-db-select
Browse files Browse the repository at this point in the history
Support database selection
  • Loading branch information
bracki authored May 24, 2019
2 parents 01c8937 + c27fae8 commit 215c9ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Prometheus/Storage/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ private function openConnection()
if ($this->options['password']) {
$this->redis->auth($this->options['password']);
}
if (isset($this->options['database'])) {
$this->redis->select($this->options['database']);
}

$this->redis->setOption(\Redis::OPT_READ_TIMEOUT, $this->options['read_timeout']);

} catch (\RedisException $e) {
throw new StorageException("Can't connect to Redis server", 0, $e);
}
Expand Down

0 comments on commit 215c9ae

Please sign in to comment.