samber / do

⚙️ A dependency injection toolkit based on Go 1.18+ Generics.
https://pkg.go.dev/github.com/samber/do
MIT License
1.82k stars 75 forks source link

shutdown all services even on error #42

Closed danilobuerger closed 9 months ago

danilobuerger commented 1 year ago

Currently when Injector.Shutdown receives an error while calling Shutdown on a service, it aborts and never calls Shutdown on the following services. It would be nice to have it behave like Injector.HealthCheck were all services are called regardless of their returned errors.

happyyi008 commented 1 year ago

Also when a service's shutdown function panics it would be nice to be able to recover from that error and finish up shutdown for other services.

danilobuerger commented 1 year ago

@samber any chance we can discuss this? I would PR it if you are open to the change!

samber commented 9 months ago

Fixed in v2 -> #45