From 660b472c322cff1a8bc93d4a996c70d8b4231951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Br=C3=A4utigam?= Date: Mon, 3 Apr 2023 12:06:53 +0200 Subject: [PATCH] Increase connect timeout, Add retries again --- config/pirsch.php | 2 +- src/Pirsch.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/config/pirsch.php b/config/pirsch.php index 5fb0189..240a47b 100644 --- a/config/pirsch.php +++ b/config/pirsch.php @@ -4,6 +4,6 @@ 'token' => env('PIRSCH_TOKEN'), - 'timeout' => env('PIRSCH_TIMEOUT', 250), + 'timeout' => env('PIRSCH_TIMEOUT', 5000), ]; diff --git a/src/Pirsch.php b/src/Pirsch.php index 330b62f..8ef95a7 100755 --- a/src/Pirsch.php +++ b/src/Pirsch.php @@ -19,6 +19,11 @@ public static function track( try { Http::withToken(config('pirsch.token')) ->timeout(config('pirsch.timeout')) + ->retry( + times: 3, + sleepMilliseconds: 100, + throw: false, + ) ->post( url: 'https://api.pirsch.io/api/v1/'.($name === null ? 'hit' : 'event'), data: [