Skip to content

Commit

Permalink
fix: do not update parent & path if graph cannot be formed
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe authored and moshloop committed May 15, 2024
1 parent 1b84b0f commit ffd184c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions db/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,12 @@ func extractConfigsAndChangesFromResults(ctx api.ScrapeContext, scrapeStartTime
if existing == nil || existing.ID == "" {
newConfigs = append(newConfigs, ci)
} else {
// In case, we are not able to derive the path & parent_id
// by forming a tree, we need to use the existing one
// otherwise they'll be updated to empty values
ci.ParentID = existing.ParentID
ci.Path = existing.Path

configsToUpdate = append(configsToUpdate, &updateConfigArgs{
Result: result,
Existing: existing,
Expand Down

0 comments on commit ffd184c

Please sign in to comment.