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
|
package routing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -407,13 +408,19 @@ retryCheck:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = r.producer.SendEventWithState(
|
// TODO: think about this some more, otherwise the request blocks and can time
|
||||||
r.req.Context(),
|
// out on the roomserver processing the new room state, when the syncapi etc
|
||||||
gomatrixserverlib.RespState(respSendJoin.RespState),
|
// would eventually get those events anyway?
|
||||||
event.Headered(respMakeJoin.RoomVersion),
|
go func() {
|
||||||
); err != nil {
|
ctx := context.TODO()
|
||||||
return nil, fmt.Errorf("r.producer.SendEventWithState: %w", err)
|
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{
|
return &util.JSONResponse{
|
||||||
Code: http.StatusOK,
|
Code: http.StatusOK,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue