From 9147bf7ea211258f09d3f8cfd76aa5a49260497b Mon Sep 17 00:00:00 2001 From: Tom Sowerby Date: Tue, 19 Jan 2016 12:05:21 +0000 Subject: [PATCH] Do events need to run in the background? I thought that I'd suggest this change to open discussion about how this currently runs. It's being raised because we noticed that a scheduled task wasn't being run. It was only after we added before and after functions for logging that it started to work. When digging into it we see that it's run in a different way when before or after functions are present. For consistency, could all scheduled tasks be run using the open_proc method rather than exec? Alternatively, should an explicit "runInBackground" flag be made available? --- src/Illuminate/Console/Scheduling/Event.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index f4128d0b4416..5760d3417421 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -142,11 +142,7 @@ protected function getDefaultOutput() */ public function run(Container $container) { - if (count($this->afterCallbacks) > 0 || count($this->beforeCallbacks) > 0) { - $this->runCommandInForeground($container); - } else { - $this->runCommandInBackground(); - } + $this->runCommandInForeground($container); } /**