mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-04-24 22:32:13 +00:00
use new methods from goprocess/context, remove thirdparty/waitable
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
parent
1cf5d8690c
commit
ea4a944533
@ -51,7 +51,7 @@ func TestGetFailures(t *testing.T) {
|
||||
err = merr[0]
|
||||
}
|
||||
|
||||
if err != context.DeadlineExceeded && err != context.Canceled {
|
||||
if err.Error() != "process closing" {
|
||||
t.Fatal("Got different error than we expected", err)
|
||||
}
|
||||
} else {
|
||||
|
4
query.go
4
query.go
@ -85,7 +85,7 @@ type dhtQueryRunner struct {
|
||||
|
||||
func newQueryRunner(q *dhtQuery) *dhtQueryRunner {
|
||||
proc := process.WithParent(process.Background())
|
||||
ctx := ctxproc.WithProcessClosing(context.Background(), proc)
|
||||
ctx := ctxproc.OnClosingContext(proc)
|
||||
return &dhtQueryRunner{
|
||||
query: q,
|
||||
peersToQuery: queue.NewChanQueue(ctx, queue.NewXORDistancePQ(q.key)),
|
||||
@ -210,7 +210,7 @@ func (r *dhtQueryRunner) queryPeer(proc process.Process, p peer.ID) {
|
||||
// ok let's do this!
|
||||
|
||||
// create a context from our proc.
|
||||
ctx := ctxproc.WithProcessClosing(context.Background(), proc)
|
||||
ctx := ctxproc.OnClosingContext(proc)
|
||||
|
||||
// make sure we do this when we exit
|
||||
defer func() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user