spatie / laravel-horizon-watcher

Automatically restart Horizon when local PHP files change
https://spatie.be/open-source
MIT License
218 stars 15 forks source link

Old processes aren't killed when changes are detected while running in Docker #26

Closed binaryfire closed 8 months ago

binaryfire commented 10 months ago

Hi guys

I'm having issues when running horizon:watch in Docker. The package is detecting changes correctly, but it's starting new processes without killing the old ones. Which means I end up with an additional set of processes every time I save a file. It only takes a few saves before all my memory is used up.

I'm using Octane with --watch as well (in a different container) if that makes a difference.

mihai-waydev commented 8 months ago

Any news here? I also run it like this in the docker entrypoint:

tini -s -- php artisan horizon:watch --without-tty & php artisan octane:start --host=0.0.0.0 --port=8083 --watch & wait -n

but after a few code changes docker just crashes completely because it probably runs out of resources.

LE: Thanks for the response, binaryfire

binaryfire commented 8 months ago

@mihai-waydev I tried a bunch of ways, including using Supervisor + a file watcher that ran horizon:terminate on file changes. That kind of worked but still wasn't 100% reliable. We ended up switching back to a simple Redis queue with queue:listen for local development. Trying to run Horizon in local development just isn't worth it IMHO.