From 40438b3b88d7164f3c18f463ee1587bde9ad8ef4 Mon Sep 17 00:00:00 2001 From: Raza Mehdi Date: Tue, 13 Sep 2016 20:01:09 +0500 Subject: [PATCH] Fix pcntl extension error for queue (#15393) --- src/Illuminate/Queue/Console/ListenCommand.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Illuminate/Queue/Console/ListenCommand.php b/src/Illuminate/Queue/Console/ListenCommand.php index 67de1d16e27e..921b3e9095cd 100755 --- a/src/Illuminate/Queue/Console/ListenCommand.php +++ b/src/Illuminate/Queue/Console/ListenCommand.php @@ -2,6 +2,7 @@ namespace Illuminate\Queue\Console; +use RuntimeException; use Illuminate\Queue\Listener; use Illuminate\Console\Command; use Symfony\Component\Console\Input\InputOption; @@ -47,6 +48,8 @@ public function __construct(Listener $listener) * Execute the console command. * * @return void + * + * @throws \RuntimeException */ public function fire() { @@ -63,6 +66,10 @@ public function fire() $timeout = $this->input->getOption('timeout'); + if ($timeout && ! function_exists('pcntl_fork')) { + throw new RuntimeException('Timeouts not supported without the pcntl_fork extension.'); + } + // We need to get the right queue for the connection which is set in the queue // configuration file for the application. We will pull it based on the set // connection being run for the queue operation currently being executed.