mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-26 15:08:28 +00:00
Process EDUs in parallel
This commit is contained in:
parent
55075a0cb5
commit
39afdcfdd3
1 changed files with 6 additions and 2 deletions
|
@ -263,7 +263,12 @@ func (t *txnReq) processTransaction(ctx context.Context) (*gomatrixserverlib.Res
|
||||||
pdus = nil // nolint:ineffassign
|
pdus = nil // nolint:ineffassign
|
||||||
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
wg.Add(len(perRoom))
|
wg.Add(len(perRoom) + 1)
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
defer wg.Done()
|
||||||
|
t.processEDUs(ctx)
|
||||||
|
}()
|
||||||
|
|
||||||
for _, q := range perRoom {
|
for _, q := range perRoom {
|
||||||
go func(q chan *gomatrixserverlib.Event) {
|
go func(q chan *gomatrixserverlib.Event) {
|
||||||
|
@ -335,7 +340,6 @@ func (t *txnReq) processTransaction(ctx context.Context) (*gomatrixserverlib.Res
|
||||||
perRoom[k] = nil
|
perRoom[k] = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
t.processEDUs(ctx)
|
|
||||||
if c := len(results); c > 0 {
|
if c := len(results); c > 0 {
|
||||||
util.GetLogger(ctx).Infof("Processed %d PDUs from transaction %q", c, t.TransactionID)
|
util.GetLogger(ctx).Infof("Processed %d PDUs from transaction %q", c, t.TransactionID)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue