Skip to content

Commit

Permalink
[FAB-8571] removing redundant time.After
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
sudeshrshetty committed Mar 15, 2018
1 parent 59fa8aa commit 6cd78cf
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 11 deletions.
4 changes: 0 additions & 4 deletions pkg/client/channel/chclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/hyperledger/fabric-sdk-go/pkg/context/api/fab"
"github.com/hyperledger/fabric-sdk-go/pkg/errors/multi"
"github.com/hyperledger/fabric-sdk-go/pkg/errors/retry"
"github.com/hyperledger/fabric-sdk-go/pkg/errors/status"
"github.com/hyperledger/fabric-sdk-go/pkg/logging"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -147,9 +146,6 @@ func (cc *Client) InvokeHandler(handler invoke.Handler, request Request, options
select {
case <-complete:
return Response(requestContext.Response), requestContext.Error
case <-time.After(requestContext.Opts.Timeouts[core.Execute]):
return Response{}, status.New(status.ClientStatus, status.Timeout.ToInt32(),
"request timed out", nil)
}
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/client/channel/invoke/txnhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ package invoke

import (
"bytes"
"time"

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

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

//Delegate to next step if any
Expand Down
2 changes: 0 additions & 2 deletions pkg/client/resmgmt/resmgmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,6 @@ func (rc *Client) sendCCProposal(reqCtx reqContext.Context, ccProposalType chain
return nil
}
return status.New(status.EventServerStatus, int32(txStatus.TxValidationCode), "instantiateOrUpgradeCC failed", nil)
case <-time.After(timeout):
return errors.New("instantiateOrUpgradeCC timeout")
}

}
Expand Down

0 comments on commit 6cd78cf

Please sign in to comment.