Skip to content

Commit

Permalink
Increase connect timeout, Add retries again
Browse files Browse the repository at this point in the history
  • Loading branch information
xyNNN committed Apr 3, 2023
1 parent 70286c3 commit 660b472
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/pirsch.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

'token' => env('PIRSCH_TOKEN'),

'timeout' => env('PIRSCH_TIMEOUT', 250),
'timeout' => env('PIRSCH_TIMEOUT', 5000),

];
5 changes: 5 additions & 0 deletions src/Pirsch.php
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

0 comments on commit 660b472

Please sign in to comment.