Skip to content

Commit

Permalink
Add 'timeout' config
Browse files Browse the repository at this point in the history
  • Loading branch information
ttrig committed May 20, 2024
1 parent 840e816 commit 0b83f4a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions config/butler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
],

],
Expand Down
2 changes: 1 addition & 1 deletion src/Heartbeat.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 0b83f4a

Please sign in to comment.