Close hanging channel in ListenForWebhookRespReqFormat
Fabio Massaioli fbbdev@users.noreply.github.com
Sun, 24 Apr 2022 03:35:19 +0200
1 files changed,
2 insertions(+),
1 deletions(-)
jump to
M
bot.go
→
bot.go
@@ -494,6 +494,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()})@@ -504,7 +506,6 @@ return
} ch <- *update - close(ch) }(w, r) return ch