Skip to content

Commit

Permalink
fix: event handler listen to ctx.Done
Browse files Browse the repository at this point in the history
  • Loading branch information
GoshaDo committed Jan 9, 2025
1 parent a6d1a48 commit d869b7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/piper/piper.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ func main() {
// Create context that listens for the interrupt signal from the OS.
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer stop()
event_handler.Start(ctx, stop, cfg, globalClients)
event_handler.Start(ctx, cfg, globalClients)
server.Start(ctx, stop, cfg, globalClients)
}
3 changes: 1 addition & 2 deletions pkg/event_handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"log"
)

func Start(ctx context.Context, stop context.CancelFunc, cfg *conf.GlobalConfig, clients *clients.Clients) {
func Start(ctx context.Context, cfg *conf.GlobalConfig, clients *clients.Clients) {
labelSelector := &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
{Key: "piper.quickube.com/notified",
Expand Down Expand Up @@ -43,7 +43,6 @@ func Start(ctx context.Context, stop context.CancelFunc, cfg *conf.GlobalConfig,
log.Printf("[event handler] failed to Handle workflow event: %v", err2)
}
}
stop()
}

}()
Expand Down

0 comments on commit d869b7c

Please sign in to comment.