Service-specific settings are defined in config/fuse.php under the services key. This allows you to set different thresholds, timeouts, and window sizes for different external dependencies.
// config/fuse.php
return [
'enabled' => env('FUSE_ENABLED', true),
'default_threshold' => 50, // Failure rate percentage to trip circuit
'default_timeout' => 60, // Seconds before testing recovery
'default_min_requests' => 10, // Minimum requests before evaluating
'default_window' => 60, // Seconds per failure-tracking window
'services' => [
'stripe' => [
'threshold' => 50,
'timeout' => 30,
'min_requests' => 5,
'release' => 15,
// Peak hours: more tolerant during business hours
'peak_hours_threshold' => 60,
'peak_hours_start' => 9, // 9 AM
'peak_hours_end' => 17, // 5 PM
],
'mailgun' => [
'threshold' => 60,
'timeout' => 120,
'min_requests' => 10,
'window' => 300, // 5-minute window
],
],
'cache' => [
'prefix' => env('FUSE_CACHE_PREFIX', 'fuse'),
],
];