diff --git a/src/ServiceProviderLaravel4.php b/src/ServiceProviderLaravel4.php index 6e2c4a389..1083f45b9 100644 --- a/src/ServiceProviderLaravel4.php +++ b/src/ServiceProviderLaravel4.php @@ -43,7 +43,10 @@ public function register() 'allow_markdown' => is_bool($allow_markdown) ? $allow_markdown : true, 'markdown_in_attachments' => is_array($markdown_in_attachments) ? $markdown_in_attachments : [], ], - new Guzzle + new Guzzle([ + 'connect_timeout' => $app['config']->get('slack.connection_timeout'), + 'timeout' => $app['config']->get('slack.request_timeout'), + ]) ); }); diff --git a/src/ServiceProviderLaravel5.php b/src/ServiceProviderLaravel5.php index 78812fb05..66bf44106 100644 --- a/src/ServiceProviderLaravel5.php +++ b/src/ServiceProviderLaravel5.php @@ -39,7 +39,10 @@ public function register() 'allow_markdown' => $app['config']->get('slack.allow_markdown'), 'markdown_in_attachments' => $app['config']->get('slack.markdown_in_attachments'), ], - new Guzzle + new Guzzle([ + 'connect_timeout' => $app['config']->get('slack.connection_timeout'), + 'timeout' => $app['config']->get('slack.request_timeout'), + ]) ); }); diff --git a/src/config/config.php b/src/config/config.php index 58590f880..b093c3984 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -15,6 +15,30 @@ 'endpoint' => '', + /* + |------------------------------------------------------------- + | Webhook connection timeout + |------------------------------------------------------------- + | + | The maximum number of seconds to wait for a connection to + | the webhook endpoint to be established + | + */ + + 'connection_timeout' => 5, + + /* + |------------------------------------------------------------- + | Webhook request timeout + |------------------------------------------------------------- + | + | The maximum number of seconds to wait for a response from + | the webhook endpoint + | + */ + + 'request_timeout' => 10, + /* |------------------------------------------------------------- | Default channel