Allow adjusting timeout

This commit is contained in:
Lance Pioch 2024-03-24 14:42:54 -04:00
parent 03e1733b7d
commit b6d39c66d1

View File

@ -13,10 +13,13 @@ class DaemonConfigurationRepository extends DaemonRepository
*
* @throws \App\Exceptions\Http\Connection\DaemonConnectionException
*/
public function getSystemInformation(?int $version = null): array
public function getSystemInformation(?int $version = null, $connectTimeout = 5): array
{
try {
$response = $this->getHttpClient()->get('/api/system' . (!is_null($version) ? '?v=' . $version : ''));
$response = $this
->getHttpClient()
->connectTimeout($connectTimeout)
->get('/api/system' . (!is_null($version) ? '?v=' . $version : ''));
} catch (TransferException $exception) {
throw new DaemonConnectionException($exception);
}