Skip to content

Commit

Permalink
Merge pull request #4 from rdohms/feature/allow-db-select
Browse files Browse the repository at this point in the history
Support database selection
  • Loading branch information
iamtgray authored Dec 3, 2018
2 parents f589568 + c27fae8 commit f796c95
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 @@ -96,7 +96,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 f796c95

Please sign in to comment.