Producer logging

This commit is contained in:
Neil Alexander 2021-08-10 14:50:35 +01:00
parent f4cc3d28e6
commit f04bba4170
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -19,6 +19,7 @@ import (
"github.com/Shopify/sarama"
"github.com/matrix-org/dendrite/eduserver/api"
"github.com/sirupsen/logrus"
)
type SigningKeyUpdate struct {
@ -46,6 +47,12 @@ func (p *SigningKeyUpdate) ProduceSigningKeyUpdate(key api.SigningKeyUpdate) err
m.Value = sarama.ByteEncoder(value)
_, _, err = p.Producer.SendMessage(&m)
if err != nil {
return err
}
logrus.WithFields(logrus.Fields{
"user_id": key.UserID,
}).Infof("Produced to cross-signing update topic '%s'", p.Topic)
return nil
}