Skip to content

Commit

Permalink
fix: remove unwanted go routines
Browse files Browse the repository at this point in the history
Signed-off-by: Vigith Maurice <[email protected]>
  • Loading branch information
vigith committed Sep 27, 2024
1 parent a1f00d4 commit d037958
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pkg/sourcer/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"runtime/debug"
"time"

"golang.org/x/sync/errgroup"
"google.golang.org/protobuf/types/known/emptypb"
"google.golang.org/protobuf/types/known/timestamppb"

Expand Down Expand Up @@ -167,14 +166,10 @@ func (fs *Service) AckFn(stream sourcepb.Source_AckFnServer) error {
}

for {
g, ctx := errgroup.WithContext(ctx)

g.Go(func() error {
return fs.receiveAckRequests(ctx, stream)
})
err := fs.receiveAckRequests(ctx, stream)

// Wait for the goroutines to finish
if err := g.Wait(); err != nil {
if err != nil {
if errors.Is(err, io.EOF) {
return nil
}
Expand Down

0 comments on commit d037958

Please sign in to comment.