From c48f70a7c6fa80e5ae472a4b7442f4826b84367f Mon Sep 17 00:00:00 2001 From: wwhai Date: Thu, 4 May 2023 23:25:43 +0800 Subject: [PATCH] fix: change 'os.Signal' channel to buffered --- cmd/api/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/api/server.go b/cmd/api/server.go index f515ffbb..7168bc13 100644 --- a/cmd/api/server.go +++ b/cmd/api/server.go @@ -136,7 +136,7 @@ func run() error { fmt.Printf("- Network: http://%s:%d/swagger/admin/index.html \r\n", pkg.GetLocaHonst(), config.ApplicationConfig.Port) fmt.Printf("%s Enter Control + C Shutdown Server \r\n", pkg.GetCurrentTimeStr()) // 等待中断信号以优雅地关闭服务器(设置 5 秒的超时时间) - quit := make(chan os.Signal) + quit := make(chan os.Signal, 1) signal.Notify(quit, os.Interrupt) <-quit