Skip to content

Commit

Permalink
Simplify run()
Browse files Browse the repository at this point in the history
It seems we only need to wait for the context to be done here.
  • Loading branch information
zmoog committed May 20, 2024
1 parent 0d80bb4 commit af52eb0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions x-pack/filebeat/input/azureeventhub/v1_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func (in *eventHubInputV1) Run(
// Start the main run loop
err = in.run(ctx)
if err != nil {
in.log.Errorw("error running input", "error", err)
return err
}

Expand Down Expand Up @@ -197,14 +198,8 @@ func (in *eventHubInputV1) run(ctx context.Context) error {

in.log.Infof("%s input worker has started.", inputName)

for ctx.Err() == nil {
select {
case <-ctx.Done():
return nil
}
}

in.log.Errorw("error during processing", "error", ctx.Err())
// wait for the context to be done
<-ctx.Done()

return ctx.Err()
}
Expand Down

0 comments on commit af52eb0

Please sign in to comment.