hemerajs / fastify-graceful-shutdown

Gracefully shutdown fastify
MIT License
70 stars 13 forks source link

Question: Why is it not possible to register multiple handlers? #36

Closed bstenersen closed 6 months ago

bstenersen commented 1 year ago

Hi, could you explain why it is not possible to register multiple handlers? Monitoring-Tools like Dynatrace register handlers as well, so it is not possible to use them along with this plugin. Is it a technical limitation of NodeJS or is it not possible because of the implementation details of the plugin?

Thanks Björn

StarpTech commented 1 year ago

Is it a technical limitation of NodeJS or is it not possible because of the implementation details of the plugin?

Because it is an anti-pattern. You should have one way to configure shutdown logic on your server. I'm ok with logging a WARN rather than throwing an error. Would you like to create a PR?

StarpTech commented 6 months ago

Close due to inactivity.

lboquillon commented 1 month ago

I am interested in take back this idea, I can send a PR logging a warning rather than throwing the exception if you are ok with that.

StarpTech commented 1 month ago

Sounds good.