Skip to content

Commit

Permalink
do not return an int since it is never used
Browse files Browse the repository at this point in the history
  • Loading branch information
kuiperda committed Oct 2, 2024
1 parent 98b19c0 commit d62ab10
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/stanza/operator/input/windows/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (i *Input) readOnInterval(ctx context.Context) {
}

// read will read events from the subscription.
func (i *Input) read(ctx context.Context) int {
func (i *Input) read(ctx context.Context) {
events, err := i.subscription.Read(i.maxReads)
if err != nil {
i.Logger().Error("Failed to read events from subscription", zap.Error(err))
Expand All @@ -199,20 +199,20 @@ func (i *Input) read(ctx context.Context) int {
closeErr := i.subscription.Close()
if closeErr != nil {
i.Logger().Error("Failed to close remote subscription", zap.Error(closeErr))
return 0
return
}
i.Logger().Info("Resubscribing, creating remote subscription")
i.subscription = NewRemoteSubscription(i.remote.Server)
if err := i.startRemoteSession(); err != nil {
i.Logger().Error("Failed to re-establish remote session", zap.String("server", i.remote.Server), zap.Error(err))
return 0
return
}
if err := i.subscription.Open(i.startAt, uintptr(i.remoteSessionHandle), i.channel, i.bookmark); err != nil {
i.Logger().Error("Failed to re-open subscription for remote server", zap.String("server", i.remote.Server), zap.Error(err))
return 0
return
}
}
return 0
return
}

for n, event := range events {
Expand All @@ -222,8 +222,6 @@ func (i *Input) read(ctx context.Context) int {
}
event.Close()
}

return len(events)
}

func (i *Input) getPublisherName(event Event) (name string, excluded bool) {
Expand Down

0 comments on commit d62ab10

Please sign in to comment.