chargebee / chargebee-php

PHP library for the Chargebee API.
https://apidocs.chargebee.com/docs/api?lang=php
MIT License
72 stars 62 forks source link

To be able to change default timeouts in the Guzzle client #59

Closed scottnimos closed 2 months ago

scottnimos commented 2 months ago

What problem does your feature request address?

For a production environment. The lib/ChargeBee/Environment.php with these defaults:

public static $connectTimeoutInSecs = 30;
public static $requestTimeoutInSecs = 80;

This is a bit too generous and can block php-fpm workers from serving other requests.

Describe the desired solution

Be able to pass in object or an array as a second optional parameter. Perhaps it makes most sense here to pass in second optional argument ChargeBee_Environment::configure

Alternatives considered

No response

Additional context

No response

cb-alish commented 2 months ago

Hi @scottnimos this is the only way to configure this currently. Please let us know if this works for you.

use ChargeBee\ChargeBee\Environment;
Environment::updateConnectTimeoutInSecs(0.25);
Environment::updateRequestTimeoutInSecs(0.25);
scottnimos commented 2 months ago

Thank you. This helps a lot. Appreciate taking your time to respond