mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 01:12:24 +08:00
only construct bitswap event loggable if necessary
Base58 encoding cids/peerIDs isn't exactly fast. License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
@ -59,11 +59,13 @@ func (bs *Bitswap) taskWorker(ctx context.Context, id int) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
log.Event(ctx, "Bitswap.TaskWorker.Work", logging.LoggableMap{
|
log.Event(ctx, "Bitswap.TaskWorker.Work", logging.LoggableF(func() map[string]interface{} {
|
||||||
"ID": id,
|
return logging.LoggableMap{
|
||||||
"Target": envelope.Peer.Pretty(),
|
"ID": id,
|
||||||
"Block": envelope.Block.Cid().String(),
|
"Target": envelope.Peer.Pretty(),
|
||||||
})
|
"Block": envelope.Block.Cid().String(),
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
|
||||||
// update the BS ledger to reflect sent message
|
// update the BS ledger to reflect sent message
|
||||||
// TODO: Should only track *useful* messages in ledger
|
// TODO: Should only track *useful* messages in ledger
|
||||||
|
Reference in New Issue
Block a user