Skip to content

Commit

Permalink
simplify ProviderResources close (#835)
Browse files Browse the repository at this point in the history
  • Loading branch information
zirain authored Dec 27, 2022
1 parent b741c72 commit ed72c15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 1 addition & 5 deletions internal/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,7 @@ func setupRunners(cfg *config.Server) error {
// Wait until done
<-ctx.Done()
// Close messages
pResources.GatewayAPIResources.Close()
pResources.GatewayStatuses.Close()
pResources.HTTPRouteStatuses.Close()
pResources.TLSRouteStatuses.Close()
pResources.UDPRouteStatuses.Close()
pResources.Close()
xdsIR.Close()
infraIR.Close()
xds.Close()
Expand Down
8 changes: 8 additions & 0 deletions internal/message/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ func (p *ProviderResources) GetResourcesKey() string {
return ""
}

func (p *ProviderResources) Close() {
p.GatewayAPIResources.Close()
p.GatewayStatuses.Close()
p.HTTPRouteStatuses.Close()
p.TLSRouteStatuses.Close()
p.UDPRouteStatuses.Close()
}

// XdsIR message
type XdsIR struct {
watchable.Map[string, *ir.Xds]
Expand Down

0 comments on commit ed72c15

Please sign in to comment.