mirror of
https://github.com/predis/predis.git
synced 2026-08-25 05:09:42 +00:00
Remove "timeout" as a default parameter in Connection\Parameters.
Falling back to a default timeout values should be done by the connection class as it is an implementation detail that may vary depending on the backend.
This commit is contained in:
@@ -33,7 +33,7 @@ use Predis\Response\Status as StatusResponse;
|
||||
* - scheme: must be 'http'.
|
||||
* - host: hostname or IP address of the server.
|
||||
* - port: TCP port of the server.
|
||||
* - timeout: timeout to perform the connection.
|
||||
* - timeout: timeout to perform the connection (default is 5 seconds).
|
||||
* - user: username for authentication.
|
||||
* - pass: password for authentication.
|
||||
*
|
||||
@@ -117,10 +117,11 @@ class WebdisConnection implements NodeConnectionInterface
|
||||
private function createCurl()
|
||||
{
|
||||
$parameters = $this->getParameters();
|
||||
$timeout = (isset($parameters->timeout) ? (float) $parameters->timeout : 5.0) * 1000;
|
||||
|
||||
$options = array(
|
||||
CURLOPT_FAILONERROR => true,
|
||||
CURLOPT_CONNECTTIMEOUT_MS => $parameters->timeout * 1000,
|
||||
CURLOPT_CONNECTTIMEOUT_MS => $timeout,
|
||||
CURLOPT_URL => "{$parameters->scheme}://{$parameters->host}:{$parameters->port}",
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_POST => true,
|
||||
|
||||
Reference in New Issue
Block a user