revert Send to SendPriority

This commit is contained in:
Anton Evangelatov 2019-03-14 15:55:20 +01:00
parent fc8ff6d993
commit a22e56974f
2 changed files with 3 additions and 4 deletions

View file

@ -295,13 +295,12 @@ func (d *Delivery) RequestFromPeers(ctx context.Context, req *network.Request) (
// this span will finish only when delivery is handled (or times out)
ctx = context.WithValue(ctx, tracing.StoreLabelId, "stream.send.request")
ctx = context.WithValue(ctx, tracing.StoreLabelMeta, fmt.Sprintf("%v.%v", sp.ID(), req.Addr))
ctx = tracing.StartSaveSpan(ctx)
log.Trace("request.from.peers", "peer", sp.ID(), "ref", req.Addr)
err := sp.Send(ctx, &RetrieveRequestMsg{
err := sp.SendPriority(ctx, &RetrieveRequestMsg{
Addr: req.Addr,
SkipCheck: req.SkipCheck,
HopCount: req.HopCount,
})
}, Top)
if err != nil {
return nil, nil, err
}

View file

@ -154,7 +154,7 @@ func (p *Peer) Deliver(ctx context.Context, chunk storage.Chunk, priority uint8,
}
ctx = context.WithValue(ctx, "stream_send_tag", nil)
return p.Send(ctx, msg)
return p.SendPriority(ctx, msg, priority)
}
// SendPriority sends message to the peer using the outgoing priority queue