Skip to content

Commit b6ced91

Browse files
committed
Make control-c twice more clear
1 parent 6d3bc32 commit b6ced91

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

cmd/tiger/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func notifyContext(parent context.Context) (context.Context, context.CancelFunc)
5050
go func() {
5151
select {
5252
case sig := <-sigChan:
53-
logging.Info("Received interrupt signal", zap.Stringer("signal", sig))
53+
logging.Info("Received interrupt signal, press control-C again to exit", zap.Stringer("signal", sig))
5454
signal.Stop(sigChan) // Restore default signal handling behavior
5555
cancel()
5656
case <-ctx.Done():

internal/tiger/cmd/mcp.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"fmt"
77
"net"
88
"net/http"
9-
"time"
109

1110
"github.com/spf13/cobra"
1211
"go.uber.org/zap"
@@ -277,10 +276,8 @@ func startHTTPServer(ctx context.Context, host string, port int) error {
277276
<-ctx.Done()
278277

279278
// Shutdown server gracefully
280-
logging.Info("Shutting down HTTP server...")
281-
shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 5*time.Second)
282-
defer shutdownCancel()
283-
if err := httpServer.Shutdown(shutdownCtx); err != nil {
279+
logging.Info("Gracefully shutting down HTTP server..., press control-C twice to immediately shutdown")
280+
if err := httpServer.Shutdown(context.Background()); err != nil {
284281
return fmt.Errorf("failed to shut down HTTP server: %w", err)
285282
}
286283

0 commit comments

Comments
 (0)