-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: gateway backend config initialisation improvements #3688
Conversation
b54ec2e
to
9d6baee
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3688 +/- ##
==========================================
- Coverage 68.27% 68.10% -0.17%
==========================================
Files 319 319
Lines 50447 50456 +9
==========================================
- Hits 34442 34365 -77
- Misses 13786 13865 +79
- Partials 2219 2226 +7
☔ View full report in Codecov by Sentry. |
9d6baee
to
35fa612
Compare
@@ -1307,7 +1309,7 @@ This function will block. | |||
*/ | |||
func (gateway *HandleT) StartWebHandler(ctx context.Context) error { | |||
gateway.logger.Infof("WebHandler waiting for BackendConfig before starting on %d", webPort) | |||
gateway.backendConfig.WaitForConfig(ctx) | |||
<-gateway.configInitialisedChan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we honor context as well here? Same for below as well?
switch {
case <-gateway.configInitialisedChan
return
case <-ctx:
return
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary since:
- the context passed to
HandleT#StartWebHandler
is exactly the same as the one passed toHandleT#Setup
andHandleT#backendConfigSubscriber
- the channel will be closed if when the context is canceled, this happens inside
HandleT#backendConfigSubscriber
Description
gateway.backendConfigSubscriber
Linear Ticket
Link
Security