Skip to content

Commit

Permalink
Add fast path if no nodes for analyzyzer in notification.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickeskov committed Oct 7, 2024
1 parent af9dce8 commit c7d214f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/analysis/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ func (a *Analyzer) processNotification(alerts chan<- entities.Alert, n entities.
if err := n.Error(); err != nil {
alerts <- entities.NewInternalErrorAlert(n.Timestamp(), err)
}
a.zap.Sugar().Infof("Statements gathering completed with %d nodes", n.NodesCount())
nodesCount := n.NodesCount()
if nodesCount == 0 { // nothing to analyze
return nil
}
a.zap.Sugar().Infof("Statements gathering completed with %d nodes", nodesCount)
cnt, err := a.es.StatementsCount()
if err != nil {
return errors.Wrap(err, "failed to get statements count")
Expand Down

0 comments on commit c7d214f

Please sign in to comment.