mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-17 03:43:11 -06:00
Don't block on roomserver (experimental)
This commit is contained in:
parent
029e750e1e
commit
426ab83bc1
|
|
@ -15,6 +15,7 @@
|
|||
package routing
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
|
@ -407,13 +408,19 @@ retryCheck:
|
|||
}
|
||||
}
|
||||
|
||||
if err = r.producer.SendEventWithState(
|
||||
r.req.Context(),
|
||||
gomatrixserverlib.RespState(respSendJoin.RespState),
|
||||
event.Headered(respMakeJoin.RoomVersion),
|
||||
); err != nil {
|
||||
return nil, fmt.Errorf("r.producer.SendEventWithState: %w", err)
|
||||
}
|
||||
// TODO: think about this some more, otherwise the request blocks and can time
|
||||
// out on the roomserver processing the new room state, when the syncapi etc
|
||||
// would eventually get those events anyway?
|
||||
go func() {
|
||||
ctx := context.TODO()
|
||||
if err = r.producer.SendEventWithState(
|
||||
ctx, //r.req.Context(),
|
||||
gomatrixserverlib.RespState(respSendJoin.RespState),
|
||||
event.Headered(respMakeJoin.RoomVersion),
|
||||
); err != nil {
|
||||
util.GetLogger(ctx).WithError(err).Error("r.producer.SendEventWithState")
|
||||
}
|
||||
}()
|
||||
|
||||
return &util.JSONResponse{
|
||||
Code: http.StatusOK,
|
||||
|
|
|
|||
Loading…
Reference in a new issue