Skip to content

Commit

Permalink
fix: update
Browse files Browse the repository at this point in the history
  • Loading branch information
GoshaDo committed Jan 13, 2025
1 parent aa2b3d6 commit 219a530
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/event_handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,17 @@ func Start(ctx context.Context, stop context.CancelFunc, cfg *conf.GlobalConfig,
Notifier: notifier,
}
go func() {
defer func() {
log.Print("[event handler] shutting down, stopping watcher")
watcher.Stop()
}()

for {
select {
case <-ctx.Done():
log.Print("[event handler] context canceled, exiting")
watcher.Stop()
return
case event, ok := <-watcher.ResultChan():
if !ok {
log.Print("[event handler] result channel closed")
stop()
return
}
if err2 := handler.Handle(ctx, &event); err2 != nil {
Expand Down

0 comments on commit 219a530

Please sign in to comment.