Skip to content

Commit

Permalink
avoid get node info blocking (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed Sep 4, 2020
1 parent 6f0f1b2 commit 28aab81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/goreleaser.yml
Expand Up @@ -11,6 +11,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up environment variables
run: |
Expand Down
2 changes: 2 additions & 0 deletions rpc/transform.go
Expand Up @@ -51,6 +51,8 @@ func toRPCNetwork(n *enginetypes.Network) *pb.Network {

func toRPCNode(ctx context.Context, n *types.Node) *pb.Node {
var nodeInfo string
ctx, cancel := context.WithTimeout(ctx, time.Second)
defer cancel()
if info, err := n.Info(ctx); err == nil {
bytes, _ := json.Marshal(info)
nodeInfo = string(bytes)
Expand Down

0 comments on commit 28aab81

Please sign in to comment.