Baldinof / caddy-supervisor

Run and supervise background processes from Caddy
MIT License
79 stars 7 forks source link

shutdown: can't call Wait twice #5

Closed delfick closed 1 year ago

delfick commented 2 years ago

When we call Wait in the Stop() method it currently returns an error that Wait has already been called and doesn't wait for the process to exit

My solution here is more of a proof of concept proposal. I'm hoping you'll have a better idea of whether this is a reasonable way to get around the problem.

Baldinof commented 2 years ago

Hi, thank you for opening this :)

It looks good to me, I'll try to test it locally.

delfick commented 2 years ago

wicked, thanks :)

I ended up needing caddy to also not expose a port before php-fpm starts and I ended up making this https://github.com/delfick/caddy-php-fpm

Baldinof commented 2 years ago

That's great :)

I had PHP on Google Cloud Run in mind for this repo but never found the time write the implementation :D

delfick commented 2 years ago

nice. I was so happy when I realised I didn't need to run a background process in my docker container. This repo gave me a massive head start to making something that seems rock solid :)