diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index e56d688afa14..201186e41e64 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -620,7 +620,6 @@ func (e *Engine) reverifierWorker(ctx context.Context) { detectorsWithResult := make(map[detectors.Detector]struct{}, avgSecretsPerDetector) chunkSecrets := make(map[string]struct{}, avgSecretsPerDetector) -nextChunk: for chunk := range e.reverifiableChunksChan { for _, detector := range chunk.detectors { // DO NOT VERIFY at this stage of the pipeline. @@ -654,8 +653,6 @@ nextChunk: if e.reverificationTracking != nil { e.reverificationTracking.increment() } - chunk.reverifyWgDoneFn() - e.processResult(ctx, detectableChunk{ chunk: chunk.chunk, detector: detector, @@ -663,14 +660,8 @@ nextChunk: wgDoneFn: wgDetect.Done, }, res) - // Empty the dupes and detectors slice. - for k := range chunkSecrets { - delete(chunkSecrets, k) - } - for k := range detectorsWithResult { - delete(detectorsWithResult, k) - } - continue nextChunk + // Remove the detector from the map as we have already processed the result. + delete(detectorsWithResult, detector) } chunkSecrets[string(val)] = struct{}{} } diff --git a/pkg/engine/engine_test.go b/pkg/engine/engine_test.go index bc059f64ca5b..db4f066052ce 100644 --- a/pkg/engine/engine_test.go +++ b/pkg/engine/engine_test.go @@ -199,7 +199,7 @@ func TestEngine_DuplicatSecrets(t *testing.T) { WithConcurrency(1), WithDecoders(decoders.DefaultDecoders()...), WithDetectors(DefaultDetectors()...), - WithVerify(true), + WithVerify(false), WithPrinter(new(discardPrinter)), ) assert.Nil(t, err)