From a7ee5501e3a27dcf5f90280c4934fe0a4a1da751 Mon Sep 17 00:00:00 2001 From: c0re100 Date: Tue, 1 Feb 2022 03:17:59 +0800 Subject: [PATCH] Fix closed channel --- client/client.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/client.go b/client/client.go index 062eb52..ec0a53f 100644 --- a/client/client.go +++ b/client/client.go @@ -165,8 +165,7 @@ func (client *Client) Send(req Request) (*Response, error) { response.Data = bytes.Replace(response.Data, []byte(strconv.FormatInt(m.Id, 10)), []byte(strconv.FormatInt(m2.Message.Id, 10)), 1) return response, nil case <-time.After(1 * time.Second): - client.successMsgStore.Delete(m.Id) - close(successCatcher) + return response, nil } } }