Make Guzzle Options Dynamic by Fetching Values from Configuration
Opened this issue · 0 comments
mdzahid-pro commented
Currently, the $guzzleOptions array in the class is hardcoded with static values for timeout, max_retry_attempts, default_retry_multiplier, and retry_on_status. We must refactor these options to be dynamically set based on environment variables or configuration files to enhance flexibility and allow environment-specific configurations.
The following items should be made dynamic:
- timeout: Set from config('basic-api.guzzle.timeout') or .env (default to 100 seconds).
- max_retry_attempts: Set from config('basic-api.guzzle.max_retry_attempts') (default to 2 attempts).
- default_retry_multiplier: Set from config('basic-api.guzzle.default_retry_multiplier') (default to 2.0).
- retry_on_status: Set from config('basic-api.guzzle.retry_on_status'), allowing for dynamic status codes based on configuration (default to [429, 503, 500]).