mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-30 11:24:45 +02:00
Add timeouts (#483)
* Add timeouts Add Timeouts to github call. * use config value
This commit is contained in:
parent
1fdff43ae7
commit
833ae30e59
@ -89,13 +89,23 @@ class SoftwareVersionService
|
|||||||
$versionData = [];
|
$versionData = [];
|
||||||
|
|
||||||
try {
|
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) {
|
if ($response->getStatusCode() === 200) {
|
||||||
$panelData = json_decode($response->getBody(), true);
|
$panelData = json_decode($response->getBody(), true);
|
||||||
$versionData['panel'] = trim($panelData['tag_name'], 'v');
|
$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) {
|
if ($response->getStatusCode() === 200) {
|
||||||
$wingsData = json_decode($response->getBody(), true);
|
$wingsData = json_decode($response->getBody(), true);
|
||||||
$versionData['daemon'] = trim($wingsData['tag_name'], 'v');
|
$versionData['daemon'] = trim($wingsData['tag_name'], 'v');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user