twitteroauth
twitteroauth copied to clipboard
Automatically increase timeouts for media uploads
5 seconds is unlikely to be enough, for media requests they should automatically be increased.
Something like this would probably work. Although it would probably be better to have two media upload values and have request use the timeout specific to the type of request being performed.
public function upload($path, array $parameters = [], $chunked = false)
{
list($connection, $timeout) = [$this->connectionTimeout, $this->timeout];
$this->setTimeouts(30, 30);
if ($chunked) {
$result = $this->uploadMediaChunked($path, $parameters);
} else {
$result = $this->uploadMediaNotChunked($path, $parameters);
}
list($this->connectionTimeout, $this->timeout) = [$connection, $timeout];
return $result
}
Related #681
TwitterOAuth is in maintenance mode and major improvements are no longer planned. https://github.com/abraham/twitteroauth/issues/1188