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

Commit 215c9ae

Browse files
authored
Merge pull request #89 from rdohms/feature/allow-db-select
Support database selection
2 parents 01c8937 + c27fae8 commit 215c9ae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Prometheus/Storage/Redis.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ private function openConnection()
9797
if ($this->options['password']) {
9898
$this->redis->auth($this->options['password']);
9999
}
100+
if (isset($this->options['database'])) {
101+
$this->redis->select($this->options['database']);
102+
}
103+
100104
$this->redis->setOption(\Redis::OPT_READ_TIMEOUT, $this->options['read_timeout']);
105+
101106
} catch (\RedisException $e) {
102107
throw new StorageException("Can't connect to Redis server", 0, $e);
103108
}

0 commit comments

Comments
 (0)