Skip to content

Commit

Permalink
fix: fatal the services if starting failed (#1405)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Wang <whynowy@gmail.com>
  • Loading branch information
whynowy committed Nov 9, 2021
1 parent f1c013b commit 84939d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eventsources/eventing.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func (e *EventSourceAdaptor) Start(ctx context.Context) error {
elector.RunOrDie(ctx, leaderelection.LeaderCallbacks{
OnStartedLeading: func(ctx context.Context) {
if err := e.run(ctx, servers); err != nil {
log.Errorw("failed to start", zap.Error(err))
log.Fatalw("failed to start", zap.Error(err))
}
},
OnStoppedLeading: func() {
Expand Down
2 changes: 1 addition & 1 deletion sensors/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (sensorCtx *SensorContext) Start(ctx context.Context) error {
elector.RunOrDie(ctx, leaderelection.LeaderCallbacks{
OnStartedLeading: func(ctx context.Context) {
if err := sensorCtx.listenEvents(ctx); err != nil {
log.Errorw("failed to start", zap.Error(err))
log.Fatalw("failed to start", zap.Error(err))
}
},
OnStoppedLeading: func() {
Expand Down

0 comments on commit 84939d6

Please sign in to comment.