mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 23:48:27 +00:00
Fix CPU spin from key change consumer when an invalid message is supplied (#2146)
This commit is contained in:
parent
585ced89bd
commit
00cbe75150
1 changed files with 4 additions and 1 deletions
|
@ -114,7 +114,10 @@ func (s *OutputCrossSigningKeyUpdateConsumer) onCrossSigningMessage(m api.Device
|
||||||
uploadRes := &api.PerformUploadDeviceKeysResponse{}
|
uploadRes := &api.PerformUploadDeviceKeysResponse{}
|
||||||
s.keyAPI.PerformUploadDeviceKeys(context.TODO(), uploadReq, uploadRes)
|
s.keyAPI.PerformUploadDeviceKeys(context.TODO(), uploadReq, uploadRes)
|
||||||
if uploadRes.Error != nil {
|
if uploadRes.Error != nil {
|
||||||
return false
|
// If the error is due to a missing or invalid parameter then we'd might
|
||||||
|
// as well just acknowledge the message, because otherwise otherwise we'll
|
||||||
|
// just keep getting delivered a faulty message over and over again.
|
||||||
|
return uploadRes.Error.IsMissingParam || uploadRes.Error.IsInvalidParam
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue