Melkeydev / go-blueprint

Go-blueprint allows users to spin up a quick Go project using a popular framework
https://docs.go-blueprint.dev/
MIT License
5.49k stars 318 forks source link

bug/gracefulShutdown #310

Closed Ujstor closed 1 month ago

Ujstor commented 1 month ago

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Problem

ListenAndServe() method blocks the main goroutine, but when gracefulShutdown(server) is called in a separate goroutine, the Shutdown() function is triggered when an interrupt signal is received.

if the server.ListenAndServe() call does not return http.ErrServerClosed, it indicates that the server did not shut down properly, causing the main goroutine to keep running and preventing a clean exit

Checklist