diff --git a/src/EngineManager.php b/src/EngineManager.php index 4e74186f..75c5136c 100644 --- a/src/EngineManager.php +++ b/src/EngineManager.php @@ -44,6 +44,18 @@ public function createAlgoliaDriver() $this->defaultAlgoliaHeaders() ); + if (is_int($connectTimeout = config('scout.algolia.connect_timeout'))) { + $config->setConnectTimeout($connectTimeout); + } + + if (is_int($readTimeout = config('scout.algolia.read_timeout'))) { + $config->setReadTimeout($readTimeout); + } + + if (is_int($writeTimeout = config('scout.algolia.write_timeout'))) { + $config->setWriteTimeout($writeTimeout); + } + return new AlgoliaEngine(Algolia::createWithConfig($config), config('scout.soft_delete')); }