From 66128bf187755d617fce23076b1c9aca2a2cb64e Mon Sep 17 00:00:00 2001 From: Igor Date: Thu, 18 Jan 2024 14:08:36 +0300 Subject: [PATCH] Rollback bad commit for setConnectTimeOut --- src/Client.php | 4 ++-- tests/FormatQueryTest.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Client.php b/src/Client.php index 6b494b4..d3cc547 100644 --- a/src/Client.php +++ b/src/Client.php @@ -183,9 +183,9 @@ public function setHost($host): void /** * max_execution_time , in int value (seconds) */ - public function setTimeout(int $timeout): Settings + public function setTimeout($timeout): Settings { - return $this->settings()->max_execution_time($timeout); + return $this->settings()->max_execution_time(intval($timeout)); } /** diff --git a/tests/FormatQueryTest.php b/tests/FormatQueryTest.php index 8172f52..fccf056 100644 --- a/tests/FormatQueryTest.php +++ b/tests/FormatQueryTest.php @@ -61,7 +61,7 @@ public function testClientTimeoutSettings() // max_execution_time - is integer in clickhouse source - Seconds $this->client->database('default'); - $timeout = 0.55; // un support, "clickhouse source - Seconds" + $timeout = 1.515; // un support, "clickhouse source - Seconds" $this->client->setTimeout($timeout); // 550 ms $this->client->select('SELECT 123,123 as ping ')->rows(); $this->assertSame(intval($timeout), intval($this->client->getTimeout())); @@ -76,7 +76,6 @@ public function testClientTimeoutSettings() $this->client->select('SELECT 123,123 as ping ')->rows(); $this->assertSame(intval($timeout), $this->client->getTimeout()); - // getConnectTimeOut is curl, can be float $timeout = 5.14; $this->client->setConnectTimeOut($timeout); // 5 seconds