twitteroauth icon indicating copy to clipboard operation
twitteroauth copied to clipboard

Automatically increase timeouts for media uploads

Open abraham opened this issue 10 years ago • 2 comments

5 seconds is unlikely to be enough, for media requests they should automatically be increased.

abraham avatar Sep 18 '15 14:09 abraham

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
}

abraham avatar Jan 03 '16 19:01 abraham

Related #681

abraham avatar Jul 03 '18 18:07 abraham

TwitterOAuth is in maintenance mode and major improvements are no longer planned. https://github.com/abraham/twitteroauth/issues/1188

abraham avatar Jul 24 '23 03:07 abraham