You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kvrocks.apache.org by hu...@apache.org on 2023/10/12 00:36:54 UTC

[kvrocks-controller] branch unstable updated: Don't exit the process while received the SIGHUP signal (#123)

This is an automated email from the ASF dual-hosted git repository.

hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks-controller.git


The following commit(s) were added to refs/heads/unstable by this push:
     new a8e3051  Don't exit the process while received the SIGHUP signal (#123)
a8e3051 is described below

commit a8e3051e8be1ab9dd548bf3dfa20b3a6202a5709
Author: hulk <hu...@gmail.com>
AuthorDate: Thu Oct 12 08:36:49 2023 +0800

    Don't exit the process while received the SIGHUP signal (#123)
---
 cmd/server/main.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cmd/server/main.go b/cmd/server/main.go
index 27b1a60..f934c8b 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -56,12 +56,12 @@ func registerSignal(shutdown chan struct{}) {
 
 func handleSignals(sig os.Signal) (exitNow bool) {
 	switch sig {
-	case syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM:
+	case syscall.SIGINT, syscall.SIGTERM:
+		logger.Get().With(zap.String("signal", sig.String())).Info("Got signal to exit")
 		return true
-	case syscall.SIGUSR1:
+	default:
 		return false
 	}
-	return false
 }
 
 func main() {