swarm: integrate OpenTracing; propagate ctx to internal APIs (#17169)
* swarm: propagate ctx, enable opentracing * swarm/tracing: log error when tracing is misconfigured
This commit is contained in:
committed by
Balint Gabor
parent
f7d3678c28
commit
7c9314f231
@ -18,6 +18,7 @@ package stream
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@ -79,7 +80,7 @@ func newTestClient(t string) *testClient {
|
||||
}
|
||||
}
|
||||
|
||||
func (self *testClient) NeedData(hash []byte) func() {
|
||||
func (self *testClient) NeedData(ctx context.Context, hash []byte) func() {
|
||||
self.receivedHashes[string(hash)] = hash
|
||||
if bytes.Equal(hash, hash0[:]) {
|
||||
return func() {
|
||||
@ -114,7 +115,7 @@ func (self *testServer) SetNextBatch(from uint64, to uint64) ([]byte, uint64, ui
|
||||
return make([]byte, HashSize), from + 1, to + 1, nil, nil
|
||||
}
|
||||
|
||||
func (self *testServer) GetData([]byte) ([]byte, error) {
|
||||
func (self *testServer) GetData(context.Context, []byte) ([]byte, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user