mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 07:04:24 +00:00
Update buffer (#3255)
This commit is contained in:
parent
dbc1464c63
commit
06bbd6fd49
1 changed files with 3 additions and 2 deletions
|
@ -457,6 +457,7 @@ func (e *Engine) initialize(ctx context.Context) error {
|
|||
// This reflects the anticipated lower volume of data that needs re-verification.
|
||||
// The buffer size is a trade-off between memory usage and the need to prevent blocking.
|
||||
verificationOverlapChunksChanMultiplier = 25
|
||||
resultsChanMultiplier = detectableChunksChanMultiplier
|
||||
)
|
||||
|
||||
// Channels are used for communication between different parts of the engine,
|
||||
|
@ -467,7 +468,7 @@ func (e *Engine) initialize(ctx context.Context) error {
|
|||
e.verificationOverlapChunksChan = make(
|
||||
chan verificationOverlapChunk, defaultChannelBuffer*verificationOverlapChunksChanMultiplier,
|
||||
)
|
||||
e.results = make(chan detectors.ResultWithMetadata, defaultChannelBuffer)
|
||||
e.results = make(chan detectors.ResultWithMetadata, defaultChannelBuffer*resultsChanMultiplier)
|
||||
e.dedupeCache = cache
|
||||
ctx.Logger().V(4).Info("engine initialized")
|
||||
|
||||
|
@ -651,7 +652,7 @@ func (e *Engine) startVerificationOverlapWorkers(ctx context.Context) {
|
|||
}
|
||||
|
||||
func (e *Engine) startNotifierWorkers(ctx context.Context) {
|
||||
const notifierWorkerRatio = 4
|
||||
const notifierWorkerRatio = 2
|
||||
maxNotifierWorkers := 1
|
||||
if numWorkers := e.concurrency / notifierWorkerRatio; numWorkers > 0 {
|
||||
maxNotifierWorkers = numWorkers
|
||||
|
|
Loading…
Reference in a new issue