Skip to content

Commit

Permalink
Cleanup fleet gateway Run
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksmaus committed Jul 18, 2024
1 parent fa52544 commit c8133c1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions internal/pkg/agent/application/gateway/fleet/fleet_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,11 @@ func (f *FleetGateway) Actions() <-chan []fleetapi.Action {
}

func (f *FleetGateway) Run(ctx context.Context) error {
// Backoff implementation doesn't support the use of a context [cancellation] as the shutdown mechanism.
// So we keep a done channel that will be closed when the current context is shutdown.
done := make(chan struct{})
backoff := backoff.NewEqualJitterBackoff(
done,
ctx.Done(),
f.settings.Backoff.Init,
f.settings.Backoff.Max,
)
go func() {
<-ctx.Done()
close(done)
}()

f.log.Info("Fleet gateway started")
for {
select {
Expand Down

0 comments on commit c8133c1

Please sign in to comment.