From a29eb830f2a2070cc9359fe844309e3f998e8d8c Mon Sep 17 00:00:00 2001 From: James Ayers Date: Thu, 25 Oct 2018 12:27:49 +1300 Subject: [PATCH] Update Process timeout via Config --- src/Solr/Reindex/Handlers/SolrReindexImmediateHandler.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Solr/Reindex/Handlers/SolrReindexImmediateHandler.php b/src/Solr/Reindex/Handlers/SolrReindexImmediateHandler.php index db5db3ba..66409f67 100644 --- a/src/Solr/Reindex/Handlers/SolrReindexImmediateHandler.php +++ b/src/Solr/Reindex/Handlers/SolrReindexImmediateHandler.php @@ -97,6 +97,13 @@ protected function processGroup( // Execute script via shell $process = new Process($cmd); + + // Set timeout from config. Process default is 60 seconds. + $timeout = Config::inst()->get(static::class, 'process_timeout'); + if ($timeout) { + $process->setTimeout($timeout); + } + $process->inheritEnvironmentVariables(); $process->run();