Merge pull request #538 from fbbdev/patch-1 Close hanging channel in ListenForWebhookRespReqFormat
Syfaro syfaro@huefox.com
Wed, 19 Oct 2022 20:31:55 -0400
1 files changed,
2 insertions(+),
1 deletions(-)
jump to
M
bot.go
→
bot.go
@@ -493,6 +493,8 @@ func (bot *BotAPI) ListenForWebhookRespReqFormat(w http.ResponseWriter, r *http.Request) UpdatesChannel {
ch := make(chan Update, bot.Buffer) func(w http.ResponseWriter, r *http.Request) { + defer close(ch) + update, err := bot.HandleUpdate(r) if err != nil { errMsg, _ := json.Marshal(map[string]string{"error": err.Error()})@@ -503,7 +505,6 @@ return
} ch <- *update - close(ch) }(w, r) return ch