0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-11-14 05:41:12 +01:00
This commit is contained in:
Neil Alexander 2021-01-29 12:55:56 +00:00
parent f68abcdb54
commit 2410ed58a4
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -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.