Fix waitgroup

This commit is contained in:
Neil Alexander 2021-07-02 10:50:07 +01:00
parent 6f129ca0ee
commit d5e01df56f
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -210,6 +210,8 @@ func (t *txnReq) processTransaction(ctx context.Context) (*gomatrixserverlib.Res
//var resultsMutex sync.Mutex //var resultsMutex sync.Mutex
var wg sync.WaitGroup var wg sync.WaitGroup
wg.Add(1) // for processEDUs
for _, pdu := range t.PDUs { for _, pdu := range t.PDUs {
pduCountTotal.WithLabelValues("total").Inc() pduCountTotal.WithLabelValues("total").Inc()
var header struct { var header struct {
@ -276,8 +278,6 @@ func (t *txnReq) processTransaction(ctx context.Context) (*gomatrixserverlib.Res
}) })
} }
wg.Wait()
go func() { go func() {
defer wg.Done() defer wg.Done()
t.processEDUs(ctx) t.processEDUs(ctx)