From 24ae5dfe94d4b33cc73b6109572c14d1251f9cb8 Mon Sep 17 00:00:00 2001 From: Irena Rindos Date: Tue, 18 Jan 2022 13:38:12 -0500 Subject: [PATCH] bug(connect): Fix Session has expired messaging --- internal/cmd/commands/connect/connect.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cmd/commands/connect/connect.go b/internal/cmd/commands/connect/connect.go index 9c50f4ad82..7b8b9b9d62 100644 --- a/internal/cmd/commands/connect/connect.go +++ b/internal/cmd/commands/connect/connect.go @@ -626,13 +626,13 @@ func (c *Command) Run(args []string) (retCode int) { case <-c.Context.Done(): termInfo.Reason = "Received shutdown signal" sendSessionCancel = true - case <-timer.C: - termInfo.Reason = "Session has expired" default: if c.execCmdReturnValue != nil { // Don't print out in this case, so ensure we clear it termInfo.Reason = "" sendSessionCancel = true + } else if !timer.Stop() { + termInfo.Reason = "Session has expired" } else { if c.connectionsLeft.Load() == 0 { termInfo.Reason = "No connections left in session"