From e8e52b82a120cd2b47ba05d2ed15338cd3a0e2b1 Mon Sep 17 00:00:00 2001 From: Finn Date: Fri, 11 Dec 2020 03:42:26 -0800 Subject: [PATCH] Close response listeners --- cmd/signald-cli/cmd/register.go | 1 + cmd/signald-cli/cmd/verify.go | 1 + 2 files changed, 2 insertions(+) diff --git a/cmd/signald-cli/cmd/register.go b/cmd/signald-cli/cmd/register.go index af2f8c5..eebf8a0 100644 --- a/cmd/signald-cli/cmd/register.go +++ b/cmd/signald-cli/cmd/register.go @@ -42,6 +42,7 @@ var registerCmd = &cobra.Command{ go s.Listen(nil) r := <-s.GetResponseListener(requestID) + defer s.CloseResponseListener(requestID) account, err := r.Data.MarshalJSON() if err != nil { log.Fatal("error rendering response:", err) diff --git a/cmd/signald-cli/cmd/verify.go b/cmd/signald-cli/cmd/verify.go index 984fbc1..baadb71 100644 --- a/cmd/signald-cli/cmd/verify.go +++ b/cmd/signald-cli/cmd/verify.go @@ -47,6 +47,7 @@ var verify = &cobra.Command{ go s.Listen(nil) r := <-s.GetResponseListener(requestID) + defer s.CloseResponseListener(requestID) account, err := r.Data.MarshalJSON() if err != nil { log.Fatal("error rendering response:", err)