Skip to content

Setting API timeout #643

Open
Open
@blaind

Description

@blaind

I've been looking for a way to set API-call timeout (for cases when openstack goes down - default is curl default, over 30 secs). Is this the correct way to set the timeout?

$os = new OpenStack(...);

// set connection options (timeout)
$config = $os->getConfig();
$curl_config = $config->get('curl.options');
$curl_config[CURLOPT_TIMEOUT] = X;
$curl_config[CURLOPT_CONNECTTIMEOUT] = X;
$config->set('curl.options', $curl_config);
$os->setConfig($config);

$service = $os->objectStoreService("swift", ...);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions