1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 14:07:02 +09:00

allow nil metric

This commit is contained in:
Sergey Cherepanov 2023-05-04 19:30:46 +02:00 committed by Mikhail Iudin
parent 183edb517c
commit 1e53e7f33b
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0

View file

@ -52,6 +52,9 @@ func Size(size int) zap.Field {
} }
func (m *metric) RequestLog(ctx context.Context, rpc string, fields ...zap.Field) { func (m *metric) RequestLog(ctx context.Context, rpc string, fields ...zap.Field) {
if m == nil {
return
}
peerId, _ := peer.CtxPeerId(ctx) peerId, _ := peer.CtxPeerId(ctx)
ak, _ := peer.CtxPubKey(ctx) ak, _ := peer.CtxPubKey(ctx)
var acc string var acc string