-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[12.x] Fix serve command ignoring PHP_CLI_WORKER_SERVERS
env
#54972
base: 12.x
Are you sure you want to change the base?
Conversation
During development, the ability to restart The only fix to prioritise |
@crynobone I understand your point. Personally, I depend way more on having multiple processes when using
Yeah, I explored sending a What if we displayed a "Automatic Reloading of Environment Variables is disabled." message when that behavior is disabled? |
Send a fix to hotwired-laravel/hotreload#2 Testbench handles this slightly differently, and would break with the above changes. |
Oh, thanks! The issue wasn't in the package itself, though. I noticed it in a Laravel app that was using the package, because the package requires more than one process due to the SSE route endpoint, and I found out it wasn't respecting the config for the number of procs. I updated the package docs to say "use the --no-reload flag" too. But this is also happening on Sail, for instance, since it doesn't default to using the |
I still believe environment reload should be prioritized (see comment above) as |
@crynobone what if we waited for the port to become available instead? I've updated the behavior to check for it. It should wait a few seconds (should be more than enough) for that to happen. If it doesn't, something is wrong so we throw an exception. |
Changed
serve
command withPHP_CLI_SERVER_WORKERS
#54606, theartisan serve
command was changed to require a--no-reload
flag when using thePHP_CLI_WORKER_SERVERS
. Instead of ignoring the config (which is the default in Laravel's scaffold), we can wait for the port to become available (for a few seconds) and throw an exception if it doesn't (clearly something went wrong and we can't recover)Related PRs:
serve
command withPHP_CLI_SERVER_WORKERS
#54606Context:
As I was working on the Hotreload package, I noticed the processes were getting stuck by the SSE endpoint. Turns out there was only 1 process, even though we set the
PHP_CLI_WORKER_SERVERS
in the default Laravel env.The current way it's working right now, we're ignoring the desired number of processes configured. With the changes here, we'd respect that but disable the auto-reload behavior. This is important for the Hotreload package, but also for Sail, since the
--no-reload
flag is not being used in the default command there.