Skip to content

Commit fadc6bc

Browse files
committed
Rename SubHeartbeatInterval to SubscriptionHeartbeatInterval
1 parent c461a8a commit fadc6bc

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

v2/pkg/engine/resolve/event_loop_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,16 @@ func TestEventLoop(t *testing.T) {
123123
testReporter := &TestReporter{}
124124

125125
resolver := New(resolverCtx, ResolverOptions{
126-
MaxConcurrency: 1024,
127-
Debug: false,
128-
AsyncErrorWriter: ew,
129-
PropagateSubgraphErrors: false,
130-
PropagateSubgraphStatusCodes: false,
131-
SubgraphErrorPropagationMode: SubgraphErrorPropagationModePassThrough,
132-
DefaultErrorExtensionCode: "TEST",
133-
MaxRecyclableParserSize: 1024 * 1024,
134-
SubHeartbeatInterval: DefaultHeartbeatInterval,
135-
Reporter: testReporter,
126+
MaxConcurrency: 1024,
127+
Debug: false,
128+
AsyncErrorWriter: ew,
129+
PropagateSubgraphErrors: false,
130+
PropagateSubgraphStatusCodes: false,
131+
SubgraphErrorPropagationMode: SubgraphErrorPropagationModePassThrough,
132+
DefaultErrorExtensionCode: "TEST",
133+
MaxRecyclableParserSize: 1024 * 1024,
134+
SubscriptionHeartbeatInterval: DefaultHeartbeatInterval,
135+
Reporter: testReporter,
136136
})
137137

138138
subscription := &GraphQLSubscription{

v2/pkg/engine/resolve/resolve.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ type ResolverOptions struct {
139139
ResolvableOptions ResolvableOptions
140140
// AllowedCustomSubgraphErrorFields defines which fields are allowed in the subgraph error when in passthrough mode
141141
AllowedSubgraphErrorFields []string
142-
// SubHeartbeatInterval defines the interval in which a heartbeat is sent to all subscriptions (whether or not this does anything is determined by the subscription response writer)
143-
SubHeartbeatInterval time.Duration
142+
// SubscriptionHeartbeatInterval defines the interval in which a heartbeat is sent to all subscriptions (whether or not this does anything is determined by the subscription response writer)
143+
SubscriptionHeartbeatInterval time.Duration
144144
// MaxSubscriptionFetchTimeout defines the maximum time a subscription fetch can take before it is considered timed out
145145
MaxSubscriptionFetchTimeout time.Duration
146146
// ApolloRouterCompatibilitySubrequestHTTPError is a compatibility flag for Apollo Router, it is used to handle HTTP errors in subrequests differently
@@ -154,8 +154,8 @@ func New(ctx context.Context, options ResolverOptions) *Resolver {
154154
options.MaxConcurrency = 32
155155
}
156156

157-
if options.SubHeartbeatInterval <= 0 {
158-
options.SubHeartbeatInterval = DefaultHeartbeatInterval
157+
if options.SubscriptionHeartbeatInterval <= 0 {
158+
options.SubscriptionHeartbeatInterval = DefaultHeartbeatInterval
159159
}
160160

161161
// We transform the allowed fields into a map for faster lookups
@@ -198,7 +198,7 @@ func New(ctx context.Context, options ResolverOptions) *Resolver {
198198
triggerUpdateBuf: bytes.NewBuffer(make([]byte, 0, 1024)),
199199
allowedErrorExtensionFields: allowedExtensionFields,
200200
allowedErrorFields: allowedErrorFields,
201-
heartbeatInterval: options.SubHeartbeatInterval,
201+
heartbeatInterval: options.SubscriptionHeartbeatInterval,
202202
maxSubscriptionFetchTimeout: options.MaxSubscriptionFetchTimeout,
203203
}
204204
resolver.maxConcurrency = make(chan struct{}, options.MaxConcurrency)

v2/pkg/engine/resolve/resolve_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ func (t *TestErrorWriter) WriteError(ctx *Context, err error, res *GraphQLRespon
8686
}
8787
}
8888

89-
var multipartSubHeartbeatInterval = 100 * time.Millisecond
89+
var subscriptionHeartbeatInterval = 100 * time.Millisecond
9090

9191
func newResolver(ctx context.Context) *Resolver {
9292
return New(ctx, ResolverOptions{
93-
MaxConcurrency: 1024,
94-
Debug: false,
95-
PropagateSubgraphErrors: true,
96-
PropagateSubgraphStatusCodes: true,
97-
AsyncErrorWriter: &TestErrorWriter{},
98-
SubHeartbeatInterval: multipartSubHeartbeatInterval,
93+
MaxConcurrency: 1024,
94+
Debug: false,
95+
PropagateSubgraphErrors: true,
96+
PropagateSubgraphStatusCodes: true,
97+
AsyncErrorWriter: &TestErrorWriter{},
98+
SubscriptionHeartbeatInterval: subscriptionHeartbeatInterval,
9999
})
100100
}
101101

0 commit comments

Comments
 (0)