Skip to content

Firefly III: a personal finances manager

Fix https://github.com/firefly-iii/firefly-iii/issues/11817

James Coleae6adf90ee67
diff --git a/app/Services/FireflyIIIOrg/Update/GitHubUpdateRequest.php b/app/Services/FireflyIIIOrg/Update/GitHubUpdateRequest.php
index 11a825cb5b..1857c130fa 100644
--- a/app/Services/FireflyIIIOrg/Update/GitHubUpdateRequest.php
+++ b/app/Services/FireflyIIIOrg/Update/GitHubUpdateRequest.php
@@ -25,8 +25,10 @@ declare(strict_types=1);
namespace FireflyIII\Services\FireflyIIIOrg\Update;
use Carbon\Carbon;
+use Exception;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
+use Illuminate\Http\Client\ConnectionException;
use Illuminate\Support\Facades\Log;
use Override;
@@ -180,7 +182,9 @@ class GitHubUpdateRequest implements UpdateRequestInterface
private function getReleases(): array
{
$client = new Client();
- $opts = ['headers' => ['User-Agent' => 'FireflyIII/'.config('firefly.version')]];
+ $opts = [
+ 'timeout' => 5.0,
+ 'headers' => ['User-Agent' => 'FireflyIII/'.config('firefly.version')]];
$return = [];
$body = '';
if ($this->localDebug && file_exists('json.json')) {
@@ -188,8 +192,8 @@ class GitHubUpdateRequest implements UpdateRequestInterface
}
if (!$this->localDebug) {
try {
- $res = $client->get('https://api.github.com/repos/firefly-iii/firefly-iii/releases', $opts);
- } catch (ClientException $e) {
+ $res = $client->get('https://api.githubsdadad.com/repos/firefly-iii/firefly-iii/releases', $opts);
+ } catch (ClientException| Exception $e) {
Log::error($e->getMessage());
return [];