Add timeouts (#483)

* Add timeouts

Add Timeouts to github call.

* use config value
This commit is contained in:
Charles 2024-07-15 19:09:52 -04:00 committed by GitHub
parent 1fdff43ae7
commit 833ae30e59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,13 +89,23 @@ class SoftwareVersionService
$versionData = [];
try {
$response = $this->client->request('GET', 'https://api.github.com/repos/pelican-dev/panel/releases/latest');
$response = $this->client->request('GET', 'https://api.github.com/repos/pelican-dev/panel/releases/latest',
[
'timeout' => config('panel.guzzle.timeout'),
'connect_timeout' => config('panel.guzzle.connect_timeout'),
]
);
if ($response->getStatusCode() === 200) {
$panelData = json_decode($response->getBody(), true);
$versionData['panel'] = trim($panelData['tag_name'], 'v');
}
$response = $this->client->request('GET', 'https://api.github.com/repos/pelican-dev/wings/releases/latest');
$response = $this->client->request('GET', 'https://api.github.com/repos/pelican-dev/wings/releases/latest',
[
'timeout' => config('panel.guzzle.timeout'),
'connect_timeout' => config('panel.guzzle.connect_timeout'),
]
);
if ($response->getStatusCode() === 200) {
$wingsData = json_decode($response->getBody(), true);
$versionData['daemon'] = trim($wingsData['tag_name'], 'v');