mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-26 05:31:32 +00:00
Send/state tweaks (#1681)
* Check missing event count * Don't use request context for /send
This commit is contained in:
parent
597350a67f
commit
05324b6861
@ -84,7 +84,7 @@ func Send(
|
|||||||
|
|
||||||
util.GetLogger(httpReq.Context()).Infof("Received transaction %q from %q containing %d PDUs, %d EDUs", txnID, request.Origin(), len(t.PDUs), len(t.EDUs))
|
util.GetLogger(httpReq.Context()).Infof("Received transaction %q from %q containing %d PDUs, %d EDUs", txnID, request.Origin(), len(t.PDUs), len(t.EDUs))
|
||||||
|
|
||||||
resp, jsonErr := t.processTransaction(httpReq.Context())
|
resp, jsonErr := t.processTransaction(context.Background())
|
||||||
if jsonErr != nil {
|
if jsonErr != nil {
|
||||||
util.GetLogger(httpReq.Context()).WithField("jsonErr", jsonErr).Error("t.processTransaction failed")
|
util.GetLogger(httpReq.Context()).WithField("jsonErr", jsonErr).Error("t.processTransaction failed")
|
||||||
return *jsonErr
|
return *jsonErr
|
||||||
@ -1005,6 +1005,7 @@ func (t *txnReq) lookupMissingStateViaStateIDs(ctx context.Context, roomID, even
|
|||||||
return t.lookupMissingStateViaState(ctx, roomID, eventID, roomVersion)
|
return t.lookupMissingStateViaState(ctx, roomID, eventID, roomVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if missingCount > 0 {
|
||||||
util.GetLogger(ctx).WithFields(logrus.Fields{
|
util.GetLogger(ctx).WithFields(logrus.Fields{
|
||||||
"missing": missingCount,
|
"missing": missingCount,
|
||||||
"event_id": eventID,
|
"event_id": eventID,
|
||||||
@ -1078,6 +1079,8 @@ func (t *txnReq) lookupMissingStateViaStateIDs(ctx context.Context, roomID, even
|
|||||||
|
|
||||||
// Wait for the workers to finish.
|
// Wait for the workers to finish.
|
||||||
fetchgroup.Wait()
|
fetchgroup.Wait()
|
||||||
|
}
|
||||||
|
|
||||||
resp, err := t.createRespStateFromStateIDs(stateIDs)
|
resp, err := t.createRespStateFromStateIDs(stateIDs)
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user