mailchimp-api
mailchimp-api copied to clipboard
General Timeout Variable
I would be easier to be able to change the timeout with a client method or variable instead of passing it into each calls.
Do you want me to make the changes and make a pull request?
You can actually change the default in one central place using the TIMEOUT
constant. Is that insufficient?
Are you finding the 10 second default too short? The MailChimp API is usually much, much faster than that.
The problem is that we cannot change it since it's a constant.
Yeah I know that the API is usually much faster, but I had some issues in the past month where some very simple calls took more than 13-14 seconds. As simple as creating a campaign or getting a list's ID. I have talked to the Mailchimp support about this issue and they are supposed too take a look at it.
And the execution time is the one from their logs and not mine so it's clearly on their end.
2018-04-03 20:00:03 GMT | POST /campaigns/ | php | 14.363s | DrewM/MailChimp-API/3.0
In that case, I'd be more interested to see self::TIMEOUT
be replaced with static::TIMEOUT
so that the constant could be overridden by inheritance.
At the same time, it might be an idea to make the private classes protected.
I find it a bit overkill to force a user to create a new class just to change some configurations.
It would be cleaner I think if you create an array of options that could be passed in the constructor, overriding some default parameters.
And adding a getOptions() setOptions() methods to modify them.
+1 for this. Also experiencing problems with timeouts after just 10 seconds.
Hello, good morning. @drewm Would something like this be accepted?
https://github.com/drewm/mailchimp-api/compare/master...driade:allow_timeout_configuration?expand=1
Thanks in advance
ping? still suffering from this...
Sure, I don't see why not.
There you're https://github.com/drewm/mailchimp-api/pull/276 , thanks in advance.