nats-io / prometheus-nats-exporter

A Prometheus exporter for NATS metrics
Apache License 2.0
381 stars 139 forks source link

[FIX] Wait in the main goroutine #285

Closed ramonberrutti closed 7 months ago

ramonberrutti commented 8 months ago

Wait in the main routine for the interrupt signal instead of exiting the main routine. We are facing some crash when we try to gracefuly shoutdown the container.

From the Official Documentation: Calling Goexit from the main goroutine terminates that goroutine without func main returning. Since func main has not returned, the program continues execution of other goroutines. If all other goroutines exit, the program crashes.

https://pkg.go.dev/runtime#Goexit