Skip to content

Commit

Permalink
✨ always separate StoreResults for score + data (#1230)
Browse files Browse the repository at this point in the history
This will ensure we don't have to separately batch scores (since their
data size is limited) while we still get to batch up data as it's coming
in.

Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus authored Apr 5, 2024
1 parent 730da3b commit 06ec689
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions policy/executor/internal/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,15 @@ func (c *BufferedCollector) run() {

c.lock.Unlock()

if len(results) > 0 && !done {
if len(results) > 0 {
c.collector.Sink(results, nil, nil, false)
results = results[:0]
}

if done {
risks := listScoredRisks(risksIdx)
c.collector.updateRiskScores(c.resolvedPolicy, scores, risks)
c.collector.Sink(results, scores, risks, done)
results = results[:0]
c.collector.Sink(nil, scores, risks, done)
scores = scores[:0]
risksIdx = map[string]bool{}
}
Expand Down

0 comments on commit 06ec689

Please sign in to comment.