Skip to content

Commit

Permalink
refactor: minor change to sensor listener
Browse files Browse the repository at this point in the history
Signed-off-by: zhaowei.wang <[email protected]>
  • Loading branch information
zhaowei.wang committed Jan 2, 2024
1 parent aca891d commit 6c20175
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sensors/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func (sensorCtx *SensorContext) triggerActions(ctx context.Context, sensor *v1al
if err != nil {
// Log the error, and let it continue
logger := logging.FromContext(ctx)
logger.Warnw("Failed to execute a trigger", zap.Error(err), zap.String(logging.LabelTriggerName, trigger.Template.Name))
logger.Errorw("Failed to execute a trigger", zap.Error(err), zap.String(logging.LabelTriggerName, trigger.Template.Name))
}
}()
return nil
Expand All @@ -380,10 +380,9 @@ func (sensorCtx *SensorContext) triggerWithRateLimit(ctx context.Context, sensor
zap.Any("triggeredBy", depNames), zap.Any("triggeredByEvents", eventIDs))
sensorCtx.metrics.ActionFailed(sensor.Name, trigger.Template.Name)
return err
} else {
sensorCtx.metrics.ActionTriggered(sensor.Name, trigger.Template.Name)
return nil
}
sensorCtx.metrics.ActionTriggered(sensor.Name, trigger.Template.Name)
return nil
}

func (sensorCtx *SensorContext) triggerOne(ctx context.Context, sensor *v1alpha1.Sensor, trigger v1alpha1.Trigger, eventsMapping map[string]*v1alpha1.Event, depNames, eventIDs []string, log *zap.SugaredLogger) error {
Expand Down

0 comments on commit 6c20175

Please sign in to comment.