title: FacebookAds\Exception\Exception: Connection timed out after 10000 milliseconds
body: <p>I have a cron job that pulls data from Facebook very frequently all day long.</p>
  
  <p>Many times per day, I get an error like this one:</p>
  
  <pre><code>FacebookAds\Exception\Exception: Connection timed out after 10001 milliseconds in /vendor/facebook/php-ads-sdk/src/FacebookAds/Http/Adapter/CurlAdapter.php:196
  Stack trace:
  #0 /vendor/facebook/php-ads-sdk/src/FacebookAds/Http/Client.php(204): FacebookAds\Http\Adapter\CurlAdapter-&gt;sendRequest(Object(FacebookAds\Http\Request))
  #1 /vendor/facebook/php-ads-sdk/src/FacebookAds/Http/Request.php(282): FacebookAds\Http\Client-&gt;sendRequest(Object(FacebookAds\Http\Request))
  #2 /vendor/facebook/php-ads-sdk/src/FacebookAds/Api.php(151): FacebookAds\Http\Request-&gt;execute()
  #3 /vendor/facebook/php-ads-sdk/src/FacebookAds/Api.php(193): FacebookAds\Api-&gt;executeRequest(Object(FacebookAds\Http\Request))
  #4 /vendor/facebook/php-ads-sdk/src/FacebookAds/ApiRequest.php(183): FacebookAds\Api-&gt;call('/act_1010015700...', 'GET', Array, Array)
  #5 /app/Helpers/FacebookHelper.php(173): FacebookAds\ApiRequest-&gt;execute()
  #6 /app/Helpers/FacebookHelper.php(271): App\Helpers\FacebookHelper-&gt;getInsights('AdAccount', 'act_10100157003...', 'ad', '2017-06-23', '2017-06-23', Array)
  #7 /app/Helpers/FacebookHelper.php(360): App\Helpers\FacebookHelper-&gt;getReport('AdAccount', 'act_10100157003...', 'ad', '2017-06-23', '2017-06-23', Array)
  #8 /app/Console/Commands/CheckWhetherFacebookAdsStartedRunning.php(50): App\Helpers\FacebookHelper-&gt;getDashAds('2017-06-23', '2017-06-23')
  #9 [internal function]: App\Console\Commands\CheckWhetherFacebookAdsStartedRunning-&gt;handle()
  #10 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
  #11 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
  #12 /vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
  #13 /vendor/laravel/framework/src/Illuminate/Container/Container.php(539): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
  #14 /vendor/laravel/framework/src/Illuminate/Console/Command.php(182): Illuminate\Container\Container-&gt;call(Array)
  #15 /vendor/symfony/console/Command/Command.php(264): Illuminate\Console\Command-&gt;execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
  #16 /vendor/laravel/framework/src/Illuminate/Console/Command.php(167): Symfony\Component\Console\Command\Command-&gt;run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
  #17 /vendor/symfony/console/Application.php(869): Illuminate\Console\Command-&gt;run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #18 /vendor/symfony/console/Application.php(223): Symfony\Component\Console\Application-&gt;doRunCommand(Object(App\Console\Commands\CheckWhetherFacebookAdsStartedRunning), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #19 /vendor/symfony/console/Application.php(130): Symfony\Component\Console\Application-&gt;doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #20 /vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Symfony\Component\Console\Application-&gt;run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #21 /artisan(35): Illuminate\Foundation\Console\Kernel-&gt;handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #22 {main}
  Level
  ----------------
  ERROR
  </code></pre>
  
  <p>I see <a href="https://github.com/facebook/facebook-php-ads-sdk/blob/2.8.2/src/FacebookAds/Http/Adapter/CurlAdapter.php#L71" rel="nofollow noreferrer">here in the Facebook API</a> that <code>CURLOPT_CONNECTTIMEOUT</code> is set to 10 seconds.</p>
  
  <p>I'd like to try adjusting the timeout to 20 seconds.</p>
  
  <p>I've been unable to figure out how to change that value without editing the source code in that library (which I definitely don't want to do because then it will be overwritten on the next upgrade).</p>
  
  <p>I'm calling <code>$ad-&gt;getInsights($fields, $params, true);</code> (<a href="https://github.com/facebook/facebook-php-ads-sdk/blob/2.8.2/src/FacebookAds/Object/Ad.php#L168" rel="nofollow noreferrer">code</a>) and then executing that request.</p>
  
  <p><strong>How can I override the Curl options that Facebook uses as a default?</strong></p>