gotd: reduce unnecessary debug logs

This commit is contained in:
Tulir Asokan
2025-12-04 14:44:13 +02:00
parent c6dd85040c
commit c83a361c0b
9 changed files with 16 additions and 41 deletions
+1 -9
View File
@@ -23,22 +23,14 @@ func (c *Conn) Invoke(ctx context.Context, input bin.Encoder, output bin.Decoder
Output: output,
}
log := c.log.With(
zap.Int64("msg_id", req.MsgID),
)
log.Debug("Invoke start")
defer log.Debug("Invoke end")
if err := c.rpc.Do(ctx, req); err != nil {
var badMsgErr *badMessageError
if errors.As(err, &badMsgErr) && badMsgErr.Code == codeIncorrectServerSalt {
// Should retry with new salt.
c.log.Debug("Setting server salt")
// Store salt from server.
c.storeSalt(badMsgErr.NewSalt)
// Reset saved salts to fetch new.
c.salts.Reset()
c.log.Info("Retrying request after basMsgErr", zap.Int64("msg_id", req.MsgID))
c.log.Info("Retrying request after updating salt from badMsgErr", zap.Int64("msg_id", req.MsgID))
return c.rpc.Do(ctx, req)
}
return err