diff --git a/src/Prometheus/Storage/Redis.php b/src/Prometheus/Storage/Redis.php index 5570685..bf4007b 100644 --- a/src/Prometheus/Storage/Redis.php +++ b/src/Prometheus/Storage/Redis.php @@ -147,12 +147,12 @@ private function connectToServer(): bool if ($this->options['persistent_connections']) { return $this->redis->pconnect( $this->options['host'], - $this->options['port'], - $this->options['timeout'] + (int) $this->options['port'], + (float) $this->options['timeout'] ); } - return $this->redis->connect($this->options['host'], $this->options['port'], $this->options['timeout']); + return $this->redis->connect($this->options['host'], (int) $this->options['port'], (float) $this->options['timeout']); } catch (\RedisException $e) { return false; }