Skip to content

Commit

Permalink
remove race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe committed Apr 11, 2024
1 parent 2d4dad6 commit 80e08f7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion impl/internal/dht/getput.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func startGetTraversal(
Target: target,
DoQuery: func(ctx context.Context, addr krpc.NodeAddr) traversal.QueryResult {
res := s.Get(ctx, dht.NewAddr(addr.UDP()), target, seq, dht.QueryRateLimiting{})
err = res.ToError()
err := res.ToError()
if err != nil && !errors.Is(err, context.Canceled) && !errors.Is(err, dht.TransactionTimeout) {
logrus.WithContext(ctx).WithError(err).Debugf("error querying %v", addr)
}
Expand Down
11 changes: 0 additions & 11 deletions impl/internal/did/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ func TestClient(t *testing.T) {
t.Logf("time to put and get: %s", since)
}

// func TestGet(t *testing.T) {
// client, err := NewGatewayClient("http://localhost:8305")
//
// require.NoError(t, err)
// require.NotNil(t, client)
//
// doc, _, _, err := client.GetDIDDocument("did:dht:uqaj3fcr9db6jg6o9pjs53iuftyj45r46aubogfaceqjbo6pp9sy")
// require.NoError(t, err)
// require.NotNil(t, doc)
// }

func TestClientInvalidGateway(t *testing.T) {
g, err := NewGatewayClient("\n")
assert.Error(t, err)
Expand Down

0 comments on commit 80e08f7

Please sign in to comment.