Skip to content

Commit

Permalink
graphql: respect timeout in block resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Aug 7, 2023
1 parent 65d8fe0 commit 8baa7f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions graphql/graphql.go
Expand Up @@ -1268,6 +1268,11 @@ func (r *Resolver) Blocks(ctx context.Context, args struct {
break
}
ret = append(ret, block)
select {
case <-ctx.Done():
return nil, ctx.Err()
default:
}
}
return ret, nil
}
Expand Down

0 comments on commit 8baa7f1

Please sign in to comment.