From 5c9a2b4697bff5b912c6b521a7ee9a4a13334e6a Mon Sep 17 00:00:00 2001 From: Jake Taylor <jake@elixxir.io> Date: Wed, 6 Jul 2022 14:12:37 -0500 Subject: [PATCH] more cleanup --- connectClient/main.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/connectClient/main.go b/connectClient/main.go index 4b37e29..fd78c24 100644 --- a/connectClient/main.go +++ b/connectClient/main.go @@ -9,6 +9,8 @@ import ( "io/fs" "io/ioutil" "os" + "os/signal" + "syscall" "time" "gitlab.com/elixxir/client/connect" @@ -179,5 +181,17 @@ func main() { // Keep app running to receive messages----------------------------------------------- - select {} + // Wait until the user terminates the program + c := make(chan os.Signal) + signal.Notify(c, os.Interrupt, syscall.SIGTERM) + <-c + + err = e2eClient.StopNetworkFollower() + if err != nil { + jww.ERROR.Printf("Failed to stop network follower: %+v", err) + } else { + jww.INFO.Printf("Stopped network follower.") + } + + os.Exit(0) } -- GitLab