Skip to content

Commit

Permalink
Rollback bad commit for setConnectTimeOut
Browse files Browse the repository at this point in the history
  • Loading branch information
isublimity committed Jan 18, 2024
1 parent a629f30 commit 66128bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand Down
3 changes: 1 addition & 2 deletions tests/FormatQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand All @@ -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
Expand Down

0 comments on commit 66128bf

Please sign in to comment.