Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduler no longer runs commands in background #12628

Closed
jordandobrev opened this issue Mar 4, 2016 · 10 comments
Closed

Scheduler no longer runs commands in background #12628

jordandobrev opened this issue Mar 4, 2016 · 10 comments

Comments

@jordandobrev
Copy link

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
9147bf7

@jordandobrev jordandobrev changed the title Scheduled tasks no longer runs commands in background Scheduler no longer runs commands in background Mar 4, 2016
@GrahamCampbell
Copy link
Member

Thanks for the report.

@GrahamCampbell
Copy link
Member

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

@StevenBock
Copy link

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

@kaleemullah1
Copy link

@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?

@StevenBock
Copy link

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

@themsaid
Copy link
Member

themsaid commented Apr 5, 2017

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

@themsaid
Copy link
Member

Closing for lack of activity.

@laurencei
Copy link
Contributor

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

@oriceon
Copy link
Contributor

oriceon commented Feb 15, 2019

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

@quemuel
Copy link

quemuel commented Jul 4, 2021

Did you have any progress on this? I've just had a similar issue....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants