Skip to content

Commit

Permalink
Do events need to run in the background?
Browse files Browse the repository at this point in the history
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?
  • Loading branch information
tomsowerby committed Jan 19, 2016
1 parent 3b60cc4 commit 9147bf7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Illuminate/Console/Scheduling/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 9147bf7

Please sign in to comment.