diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ad3693..61b3be4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - **BREAKING**: Enum `ResultState`. - Config `butler.health.heartbeat.report`. +- Config `butler.health.heartbeat.timeout`. ## [0.5.2] - 2023-12-29 ### Added diff --git a/config/butler.php b/config/butler.php index 90dc239..e2224ef 100644 --- a/config/butler.php +++ b/config/butler.php @@ -12,6 +12,7 @@ 'url' => env('BUTLER_HEALTH_HEARTBEAT_URL'), 'token' => env('BUTLER_HEALTH_HEARTBEAT_TOKEN'), 'report' => env('BUTLER_HEALTH_HEARTBEAT_REPORT'), + 'timeout' => env('BUTLER_HEALTH_HEARTBEAT_TIMEOUT'), ], ], diff --git a/src/Heartbeat.php b/src/Heartbeat.php index 60a41a7..78e5f98 100644 --- a/src/Heartbeat.php +++ b/src/Heartbeat.php @@ -34,7 +34,7 @@ public function send(string $slug, int $minutes = 1): void $config = config('butler.health.heartbeat'); Http::withToken($config['token'] ?? null) - ->timeout(5) + ->timeout($config['timeout'] ?? 5) ->acceptJson() ->post($url) ->onError(fn ($response) => report_if(