Open lordvidex opened 1 year ago
Yeah, I got the same issue, I was running reflex -sr '\.go$' go run ./cmd/main.go
where main.go
has shutdown function on signals (SIGINT, SIGTERM), But it was not getting triggered
What OS are you on? Because this exact same command is working just fine for me on linux zsh shell. This is my graceful shutdown logic:
server := &http.Server{
Addr: ":8000",
Handler: myHandler,
}
go func() {
if err := server.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
log.Println("error while listening", err)
}
}()
done := make(chan os.Signal, 1)
signal.Notify(done, syscall.SIGINT, syscall.SIGTERM)
sig := <-done
log.Println("shutting down...")
...
感谢您的来信,我尽快回复您!
when running a server that has graceful shutdown logic intercepting the os signals, reflex intercepts them and prevent cleanup logic.