diff --git a/internal/nodetree/nodetree.go b/internal/nodetree/nodetree.go index 397bedf..b661f35 100644 --- a/internal/nodetree/nodetree.go +++ b/internal/nodetree/nodetree.go @@ -248,9 +248,10 @@ func (n *Node) Close(timestamp uint64) { func FindNodeByFingerprint(target uint32, nodes []*Node) *Node { for _, node := range nodes { - if node.Frame.Fingerprint() != target { + if node.Frame.Fingerprint() == target { return node } + node := FindNodeByFingerprint(target, node.Children) if node != nil { return node diff --git a/internal/occurrence/occurrence.go b/internal/occurrence/occurrence.go index 854b855..17eff29 100644 --- a/internal/occurrence/occurrence.go +++ b/internal/occurrence/occurrence.go @@ -222,6 +222,7 @@ func FromRegressedFunction(p profile.Profile, regressed RegressedFunction, f fra ProjectID: regressed.ProjectID, Received: now, Timestamp: now, + Tags: make(map[string]string), }, EvidenceData: map[string]interface{}{ "organization_id": regressed.OrganizationID, diff --git a/internal/occurrence/regressed_frame.go b/internal/occurrence/regressed_frame.go index 9bb5d7e..b981c23 100644 --- a/internal/occurrence/regressed_frame.go +++ b/internal/occurrence/regressed_frame.go @@ -106,16 +106,18 @@ func ProcessRegressedFunctions( }() } - for _, regressedFunction := range regressedFunctions { - regressedChan <- regressedFunction - } - close(regressedChan) - - // wait until all the profiles have been processed - // then we can close the occurrence channel and collect - // any occurrences that have been created - wg.Wait() - close(occurrenceChan) + go func() { + for _, regressedFunction := range regressedFunctions { + regressedChan <- regressedFunction + } + close(regressedChan) + + // wait until all the profiles have been processed + // then we can close the occurrence channel and collect + // any occurrences that have been created + wg.Wait() + close(occurrenceChan) + }() occurrences := []*Occurrence{} for occurrence := range occurrenceChan {