fix: cannot trap sigkill -9

Signed-off-by: rfyiamcool <rfyiamcool@163.com>
This commit is contained in:
rfyiamcool 2024-03-12 18:55:46 +08:00
parent 4257788f33
commit d35bd7adc2
No known key found for this signature in database
GPG Key ID: EBA61C4D83B4DC5C

View File

@ -279,7 +279,7 @@ func runMain(cmd *cobra.Command, args []string) {
go func() {
// Graceful shutdown
shutdownChan := make(chan os.Signal)
signal.Notify(shutdownChan, os.Interrupt, os.Kill)
signal.Notify(shutdownChan, os.Interrupt, os.Kill, syscall.SIGTERM)
<-shutdownChan
logger.Info("shutting down gracefully...")
cancelFunc()