Don't block on roomserver (experimental)

This commit is contained in:
Neil Alexander 2020-04-20 11:15:15 +01:00
parent 029e750e1e
commit 426ab83bc1

View file

@ -15,6 +15,7 @@
package routing
import (
"context"
"fmt"
"net/http"
"strings"
@ -407,13 +408,19 @@ retryCheck:
}
}
// 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(
r.req.Context(),
ctx, //r.req.Context(),
gomatrixserverlib.RespState(respSendJoin.RespState),
event.Headered(respMakeJoin.RoomVersion),
); err != nil {
return nil, fmt.Errorf("r.producer.SendEventWithState: %w", err)
util.GetLogger(ctx).WithError(err).Error("r.producer.SendEventWithState")
}
}()
return &util.JSONResponse{
Code: http.StatusOK,