From 80e08f7336cd3ef947f2c67cef34da838f35c420 Mon Sep 17 00:00:00 2001 From: gabe Date: Thu, 11 Apr 2024 15:12:40 -0400 Subject: [PATCH] remove race condition --- impl/internal/dht/getput.go | 2 +- impl/internal/did/client_test.go | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/impl/internal/dht/getput.go b/impl/internal/dht/getput.go index 71d9a906..52cbe9c1 100644 --- a/impl/internal/dht/getput.go +++ b/impl/internal/dht/getput.go @@ -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) } diff --git a/impl/internal/did/client_test.go b/impl/internal/did/client_test.go index 5051b453..42ceecd3 100644 --- a/impl/internal/did/client_test.go +++ b/impl/internal/did/client_test.go @@ -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)