Skip to content

Commit

Permalink
Added ability to set timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
denpamusic committed Dec 8, 2019
1 parent eea66d0 commit aaaa048
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ public function __construct($config = [])

// construct client
$this->client = new GuzzleHttp([
'base_uri' => $this->config->getDsn(),
'auth' => $this->config->getAuth(),
'verify' => $this->config->getCa(),
'handler' => $this->getHandler(),
'base_uri' => $this->config->getDsn(),
'auth' => $this->config->getAuth(),
'verify' => $this->config->getCa(),
'timeout' => (float) $this->config['timeout'],
'connect_timeout' => (float) $this->config['timeout'],
'handler' => $this->getHandler(),
]);
}

Expand Down
1 change: 1 addition & 0 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Config implements \ArrayAccess, \Countable
'user' => null,
'password' => null,
'ca' => null,
'timeout' => false,
'preserve_case' => false,
];

Expand Down

0 comments on commit aaaa048

Please sign in to comment.