Skip to content

Commit

Permalink
Always cast redis port and timeout to the correct value types
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Kämmerling <[email protected]>
  • Loading branch information
LKaemmerling committed Oct 2, 2020
1 parent d5e9c36 commit 4c898dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Prometheus/Storage/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ private function connectToServer(): void
if ($this->options['persistent_connections']) {
$connection_successful = $this->redis->pconnect(
$this->options['host'],
$this->options['port'],
$this->options['timeout']
(int) $this->options['port'],
(float) $this->options['timeout']
);
} else {
$connection_successful = $this->redis->connect($this->options['host'], $this->options['port'], $this->options['timeout']);
$connection_successful = $this->redis->connect($this->options['host'], (int) $this->options['port'], (float) $this->options['timeout']);
}
if (!$connection_successful) {
throw new StorageException("Can't connect to Redis server", 0);
Expand Down

0 comments on commit 4c898dc

Please sign in to comment.