Skip to content
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

Small clean up of the fleet gateway "run" function implementation #5169

Merged
merged 11 commits into from
Jul 23, 2024
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