Skip to content

Commit

Permalink
refactor(handler.go): remove unnecessary sync.WaitGroup usage in hand…
Browse files Browse the repository at this point in the history
…leEvents function to simplify code and improve readability
  • Loading branch information
bounoable committed Sep 20, 2023
1 parent bb69ef0 commit 65e0bfd
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions event/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,8 @@ func (h *Handler) Run(ctx context.Context) (<-chan error, error) {

func (h *Handler) handleEvents(ctx context.Context, events <-chan event.Event) <-chan error {
errs, fail := concurrent.Errors(ctx)
var wg sync.WaitGroup
for i := 0; i < h.workers; i++ {
wg.Add(1)
go func() {
defer wg.Done()
for evt := range events {
fn, ok := h.EventHandler(evt.Name())
if !ok {
Expand Down

0 comments on commit 65e0bfd

Please sign in to comment.