Skip to content

Commit

Permalink
chore: cleaner error count for orphaned
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra authored and adityathebe committed Jun 28, 2024
1 parent c6d9b55 commit 847f840
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func updateCI(ctx api.ScrapeContext, result v1.ScrapeResult, ci, existing *model
if newChanges, _, orphanedChanges, err := extractChanges(ctx, &result, ci); err != nil {
return false, nil, err
} else {
ctx.JobHistory().ErrorCount += orphanedChanges
ctx.JobHistory().AddErrorf("%d changes were orphaned for config item: [%s/%s]", orphanedChanges, existing.ID, *existing.Name)
changes = append(changes, newChanges...)
}

Expand Down Expand Up @@ -345,7 +345,7 @@ func saveResults(ctx api.ScrapeContext, isPartialResultSet bool, results []v1.Sc
if err != nil {
return fmt.Errorf("failed to extract configs & changes from results: %w", err)
}
ctx.JobHistory().ErrorCount += orphanedChanges
ctx.JobHistory().AddErrorf("%d changes were orphaned for scraper: [%s/%s]", orphanedChanges, ctx.ScrapeConfig().Namespace, ctx.ScrapeConfig().Name)

ctx.Logger.V(2).Infof("%d new configs, %d configs to update, %d new changes & %d changes to update",
len(newConfigs), len(configsToUpdate), len(newChanges), len(changesToUpdate))
Expand Down

0 comments on commit 847f840

Please sign in to comment.