From f91b01f8173e0cf33ed68b27f258ac1716c3446b Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 29 Jun 2021 14:38:59 +0100 Subject: [PATCH] Update comments --- roomserver/internal/input/input.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roomserver/internal/input/input.go b/roomserver/internal/input/input.go index 61f46cb2..e42c20d4 100644 --- a/roomserver/internal/input/input.go +++ b/roomserver/internal/input/input.go @@ -130,9 +130,9 @@ func (r *Inputer) InputRoomEvents( request *api.InputRoomEventsRequest, response *api.InputRoomEventsResponse, ) { - // Create a wait group. Each task that we dispatch will call Done on - // this wait group so that we know when all of our events have been - // processed. + // Each of the requests will return to us on the wait channel. + // We can also close the wait channel early if the request context + // comes to an end, so that we don't leak goroutines. ctx, cancel := context.WithCancel(ctx) defer cancel() count := len(request.InputRoomEvents)