From 56484a2282b5cf68c441b3154e3e411b20ef334b Mon Sep 17 00:00:00 2001 From: Boy132 Date: Sat, 20 Jul 2024 17:18:45 +0200 Subject: [PATCH] Increase guzzle timeout when running tests (#485) * increase guzzle timeout when running tests * catch correct exception --- .github/workflows/ci.yaml | 6 ++++++ app/Services/Helpers/SoftwareVersionService.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 43a644a99..92fea58bd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,6 +41,8 @@ jobs: DB_HOST: 127.0.0.1 DB_DATABASE: testing DB_USERNAME: root + GUZZLE_TIMEOUT: 60 + GUZZLE_CONNECT_TIMEOUT: 60 steps: - name: Code Checkout uses: actions/checkout@v4 @@ -113,6 +115,8 @@ jobs: DB_HOST: 127.0.0.1 DB_DATABASE: testing DB_USERNAME: root + GUZZLE_TIMEOUT: 60 + GUZZLE_CONNECT_TIMEOUT: 60 steps: - name: Code Checkout uses: actions/checkout@v4 @@ -173,6 +177,8 @@ jobs: QUEUE_CONNECTION: sync DB_CONNECTION: sqlite DB_DATABASE: testing.sqlite + GUZZLE_TIMEOUT: 60 + GUZZLE_CONNECT_TIMEOUT: 60 steps: - name: Code Checkout uses: actions/checkout@v4 diff --git a/app/Services/Helpers/SoftwareVersionService.php b/app/Services/Helpers/SoftwareVersionService.php index cb7021a74..7d50203bf 100644 --- a/app/Services/Helpers/SoftwareVersionService.php +++ b/app/Services/Helpers/SoftwareVersionService.php @@ -4,7 +4,7 @@ namespace App\Services\Helpers; use GuzzleHttp\Client; use Carbon\CarbonImmutable; -use GuzzleHttp\Exception\ClientException; +use GuzzleHttp\Exception\GuzzleException; use Illuminate\Support\Arr; use Illuminate\Contracts\Cache\Repository as CacheRepository; @@ -110,7 +110,7 @@ class SoftwareVersionService $wingsData = json_decode($response->getBody(), true); $versionData['daemon'] = trim($wingsData['tag_name'], 'v'); } - } catch (ClientException $e) { + } catch (GuzzleException $e) { } $versionData['discord'] = 'https://pelican.dev/discord';