Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit 6cd78cf

Browse files
committed
[FAB-8571] removing redundant time.After
- Since request contexts are taking care of cancelling contexts if deadline exceeds, there is not need of 'time.After' handling in those cases. Change-Id: Ic777d23a7904f90c2e211e9dfe5f4f5a086a17bd Signed-off-by: Sudesh Shetty <sudesh.shetty@securekey.com>
1 parent 59fa8aa commit 6cd78cf

File tree

3 files changed

+0
-11
lines changed

3 files changed

+0
-11
lines changed

pkg/client/channel/chclient.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/hyperledger/fabric-sdk-go/pkg/context/api/fab"
2121
"github.com/hyperledger/fabric-sdk-go/pkg/errors/multi"
2222
"github.com/hyperledger/fabric-sdk-go/pkg/errors/retry"
23-
"github.com/hyperledger/fabric-sdk-go/pkg/errors/status"
2423
"github.com/hyperledger/fabric-sdk-go/pkg/logging"
2524
"github.com/pkg/errors"
2625
)
@@ -147,9 +146,6 @@ func (cc *Client) InvokeHandler(handler invoke.Handler, request Request, options
147146
select {
148147
case <-complete:
149148
return Response(requestContext.Response), requestContext.Error
150-
case <-time.After(requestContext.Opts.Timeouts[core.Execute]):
151-
return Response{}, status.New(status.ClientStatus, status.Timeout.ToInt32(),
152-
"request timed out", nil)
153149
}
154150
}
155151

pkg/client/channel/invoke/txnhandler.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ package invoke
88

99
import (
1010
"bytes"
11-
"time"
1211

1312
"github.com/hyperledger/fabric-sdk-go/pkg/errors/status"
1413
"github.com/pkg/errors"
1514

16-
"github.com/hyperledger/fabric-sdk-go/pkg/context/api/core"
1715
"github.com/hyperledger/fabric-sdk-go/pkg/context/api/fab"
1816
"github.com/hyperledger/fabric-sdk-go/pkg/fab/peer"
1917
"github.com/hyperledger/fabric-sdk-go/pkg/fab/txn"
@@ -164,9 +162,6 @@ func (c *CommitTxHandler) Handle(requestContext *RequestContext, clientContext *
164162
requestContext.Error = status.New(status.EventServerStatus, int32(txStatus.TxValidationCode), "received invalid transaction", nil)
165163
return
166164
}
167-
case <-time.After(requestContext.Opts.Timeouts[core.Execute]):
168-
requestContext.Error = errors.New("Execute didn't receive block event")
169-
return
170165
}
171166

172167
//Delegate to next step if any

pkg/client/resmgmt/resmgmt.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,6 @@ func (rc *Client) sendCCProposal(reqCtx reqContext.Context, ccProposalType chain
603603
return nil
604604
}
605605
return status.New(status.EventServerStatus, int32(txStatus.TxValidationCode), "instantiateOrUpgradeCC failed", nil)
606-
case <-time.After(timeout):
607-
return errors.New("instantiateOrUpgradeCC timeout")
608606
}
609607

610608
}

0 commit comments

Comments
 (0)