Framework: Scheduler no longer runs commands in background

Created on 4 Mar 2016  路  9Comments  路  Source: laravel/framework

Removal of the check and function that checks whether a scheduled task should be executed in background causes issues with long tasks.

$schedule->command("email:customers")->withoutOverlapping();
$schedule->command("email:organisations")->withoutOverlapping();
$schedule->command("email:administrators")->withoutOverlapping();

After the removal of runCommandInBackground each scheduled task waits for the previous one to finish before it can start.

Is there another way to force it to run as a Background process?

issue is caused by the change in commit
https://github.com/laravel/framework/commit/9147bf7ea211258f09d3f8cfd76aa5a49260497b

Most helpful comment

@StevenBock @laurencei same issue here. Any fix for that?

All 9 comments

Thanks for the report.

Thanks in particular for the link to the commit. That's very helpful. :)

Unfortunately, this seems to still be an issue on Windows.

I have a command registered as below:

$schedule->command('callLifeCycle:processNewCalls 10') ->runInBackground() ->everyMinute() ->sendOutputTo(storage_path('test.txt'));

When letting the scheduled Windows task run (which in turn runs artisan schedule:run), the background command does not actually execute despite showing as being called in the command line. This image shows the output I receive when running artisan schedule:run. If I take out the runInBackground call, it works as expected.

If there are more details I can provide, I'd be more than happy to. Thanks

@GrahamCampbell when i use command * * * * * php path/artisan schedule:run > /dev/null 2>&1 then its not working. but when i use php path/artisan schedule:run > /dev/null 2>&1 then it works but only for once. could you please guid me?

I think this has some unfortunate underpinnings in the Syfmony process component. I played around with trying to get a Symfony process to run in the background on Windows and wasn't having much luck.

I'll try again to see if I have some luck that I can transfer over to this project

@StevenBock I wonder if you have any updates regarding this?

Closing for lack of activity.

@StevenBock - did you have any progress on this? I've just had a similar issue....

@StevenBock @laurencei same issue here. Any fix for that?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

YannPl picture YannPl  路  3Comments

progmars picture progmars  路  3Comments

ghost picture ghost  路  3Comments

shopblocks picture shopblocks  路  3Comments

JamborJan picture JamborJan  路  3Comments