From 4e4d5ca3c4b9871512f66a2e02688f067bf54618 Mon Sep 17 00:00:00 2001
From: Jake Taylor <jake@elixxir.io>
Date: Mon, 14 Feb 2022 14:01:48 -0600
Subject: [PATCH] cleanup; reduce kill timeout

---
 cmd/root.go               | 5 +++--
 internal/round/manager.go | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/cmd/root.go b/cmd/root.go
index c6632702..57fc7119 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -91,7 +91,7 @@ var rootCmd = &cobra.Command{
 		case <-stopCh:
 			jww.INFO.Printf(
 				"Received Exit (SIGTERM or SIGINT) signal...\n")
-			instance.WaitUntilRoundCompletes(60 * time.Second)
+			instance.WaitUntilRoundCompletes(30 * time.Second)
 			if profileOut != "" {
 				pprof.StopCPUProfile()
 			}
@@ -134,7 +134,8 @@ func init() {
 
 	rootCmd.Flags().String("profile-cpu", "",
 		"Enable cpu profiling to this file")
-	viper.BindPFlag("profile-cpu", rootCmd.Flags().Lookup("profile-cpu"))
+	err = viper.BindPFlag("profile-cpu", rootCmd.Flags().Lookup("profile-cpu"))
+	handleBindingError(err, "profile-cpu")
 
 	rootCmd.Flags().String("registrationCode", "",
 		"Registration code used for first time registration. This is a unique "+
diff --git a/internal/round/manager.go b/internal/round/manager.go
index d6f73f1b..502bf63f 100644
--- a/internal/round/manager.go
+++ b/internal/round/manager.go
@@ -60,7 +60,7 @@ func (rm *Manager) GetRound(id id.Round) (*Round, error) {
 // as it is intended to be called from network handlers
 func (rm *Manager) GetPhase(id id.Round, phaseTy int32) (phase.Phase, error) {
 	// First, check that the phase type id # is valid
-	if phaseTy < 0 || phaseTy >= int32(phase.NUM_PHASES) {
+	if phaseTy < 0 || phaseTy >= phase.NUM_PHASES {
 		return nil, errors.Errorf("Invalid phase Type Number: %d",
 			phaseTy)
 	}
-- 
GitLab