Skip to content

Commit

Permalink
Fix context capture
Browse files Browse the repository at this point in the history
  • Loading branch information
karimodm committed Oct 31, 2023
1 parent a8f35c6 commit 5349814
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/dashboard/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func run() error {
Component.LogInfo("Starting Dashboard ... done")

stopped := make(chan struct{})
go func() {
go func(ctx context.Context) {
server.Server.BaseContext = func(_ net.Listener) context.Context {
// set BaseContext to be the same as the plugin, so that requests being processed don't hang the shutdown procedure
return ctx
Expand All @@ -81,7 +81,7 @@ func run() error {
}
close(stopped)
}
}()
}(ctx)

// stop if we are shutting down or the server could not be started
select {
Expand Down

0 comments on commit 5349814

Please sign in to comment.