From 2410ed58a49979fb1c18cbe28c0fa33296dcc479 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 29 Jan 2021 12:55:56 +0000 Subject: [PATCH] Fixes --- syncapi/streams/stream_pdu.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syncapi/streams/stream_pdu.go b/syncapi/streams/stream_pdu.go index 4bc9d1b14..086e315c2 100644 --- a/syncapi/streams/stream_pdu.go +++ b/syncapi/streams/stream_pdu.go @@ -55,9 +55,9 @@ func (p *PDUStreamProvider) CompleteSync( // Build up a /sync response. Add joined rooms. var reqMutex sync.Mutex var reqWaitGroup sync.WaitGroup - reqWaitGroup.Add(len(joinedRooms)) + reqWaitGroup.Add(len(joinedRoomIDs)) for _, roomID := range joinedRoomIDs { - go func() { + go func(roomID string) { defer reqWaitGroup.Done() var jr *types.JoinResponse jr, err = p.getJoinResponseForCompleteSync( @@ -71,7 +71,7 @@ func (p *PDUStreamProvider) CompleteSync( defer reqMutex.Unlock() req.Response.Rooms.Join[roomID] = *jr req.Rooms[roomID] = gomatrixserverlib.Join - }() + }(roomID) } // Add peeked rooms.