Skip to content

Commit

Permalink
Merge pull request #9 from PromPHP/always-cast-redis-port-and-timeout
Browse files Browse the repository at this point in the history
Always cast redis port and timeout to the correct value types
  • Loading branch information
LKaemmerling authored Oct 2, 2020
2 parents d5e9c36 + 4c898dc commit 169d8e4
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 169d8e4

Please sign in to comment.