Skip to content

Find, verify, and analyze leaked credentials

concurrency uint8 to int (#2488)

Zachary Ricebccba20d3eed
diff --git a/main.go b/main.go
index 390b1d338..ae1accb33 100644
--- a/main.go
+++ b/main.go
@@ -405,7 +405,7 @@ func run(state overseer.State) {
jobReportWriter = *jobReportFile
}
e, err := engine.Start(ctx,
- engine.WithConcurrency(uint8(*concurrency)),
+ engine.WithConcurrency(*concurrency),
engine.WithDecoders(decoders.DefaultDecoders()...),
engine.WithDetectors(engine.DefaultDetectors()...),
engine.WithDetectors(conf.Detectors...),
@@ -568,7 +568,6 @@ func run(state overseer.State) {
if err = e.Finish(ctx); err != nil {
logFatal(err, "engine failed to finish execution")
}
-
if err := cleantemp.CleanTempArtifacts(ctx); err != nil {
ctx.Logger().Error(err, "error cleaning temp artifacts")
}
diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go
index ce4945316..4acc65b6e 100644
--- a/pkg/engine/engine.go
+++ b/pkg/engine/engine.go
@@ -59,7 +59,7 @@ type Printer interface {
type Engine struct {
// CLI flags.
- concurrency uint8
+ concurrency int
decoders []decoders.Decoder
detectors []detectors.Detector
jobReportWriter io.WriteCloser
@@ -127,7 +127,7 @@ func WithJobReportWriter(w io.WriteCloser) Option {
}
}
-func WithConcurrency(concurrency uint8) Option {
+func WithConcurrency(concurrency int) Option {
return func(e *Engine) {
e.concurrency = concurrency
}
@@ -430,7 +430,7 @@ func (e *Engine) setDefaults(ctx context.Context) {
if e.concurrency == 0 {
numCPU := runtime.NumCPU()
ctx.Logger().Info("No concurrency specified, defaulting to max", "cpu", numCPU)
- e.concurrency = uint8(numCPU)
+ e.concurrency = numCPU
}
ctx.Logger().V(3).Info("engine started", "workers", e.concurrency)
diff --git a/pkg/engine/git_test.go b/pkg/engine/git_test.go
index d891f2be2..bc6b2a145 100644
--- a/pkg/engine/git_test.go
+++ b/pkg/engine/git_test.go
@@ -112,7 +112,7 @@ func BenchmarkGitEngine(b *testing.B) {
defer cancel()
e, err := Start(ctx,
- WithConcurrency(uint8(runtime.NumCPU())),
+ WithConcurrency(runtime.NumCPU()),
WithDecoders(decoders.DefaultDecoders()...),
WithDetectors(DefaultDetectors()...),
WithVerify(false),