diff --git a/src/LaunchDarkly/Impl/Integrations/CurlEventPublisher.php b/src/LaunchDarkly/Impl/Integrations/CurlEventPublisher.php index 0ea2961e..c3d530ad 100644 --- a/src/LaunchDarkly/Impl/Integrations/CurlEventPublisher.php +++ b/src/LaunchDarkly/Impl/Integrations/CurlEventPublisher.php @@ -22,6 +22,7 @@ class CurlEventPublisher implements EventPublisher private bool $_ssl; private string $_curl = '/usr/bin/env curl'; private int $_connectTimeout; + private int $_timeout; private bool $_isWindows; /** @var array */ @@ -51,6 +52,7 @@ public function __construct(string $sdkKey, array $options = []) $this->_eventHeaders = Util::eventHeaders($sdkKey, $options); $this->_connectTimeout = $options['connect_timeout']; + $this->_timeout = $options['timeout']; $this->_isWindows = PHP_OS_FAMILY == 'Windows'; } @@ -81,6 +83,7 @@ private function createCurlArgs(string $payload): string $scheme = $this->_ssl ? "https://" : "http://"; $args = " -X POST"; $args.= " --connect-timeout " . $this->_connectTimeout; + $args.= " --max-time " . $this->_timeout; foreach ($this->_eventHeaders as $key => $value) { if ($key == 'Authorization') {