mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 15:14:38 +00:00
Call Finish in SourceManager after the semaphore is released (#2121)
This commit is contained in:
parent
024aa056b9
commit
78219a27b3
1 changed files with 2 additions and 1 deletions
|
@ -123,6 +123,8 @@ func (s *SourceManager) asyncRun(ctx context.Context, sourceName string, source
|
||||||
}
|
}
|
||||||
s.wg.Add(1)
|
s.wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
|
// Call Finish after the semaphore has been released.
|
||||||
|
defer progress.Finish()
|
||||||
defer s.sem.Release(1)
|
defer s.sem.Release(1)
|
||||||
defer s.wg.Done()
|
defer s.wg.Done()
|
||||||
ctx := context.WithValues(ctx,
|
ctx := context.WithValues(ctx,
|
||||||
|
@ -216,7 +218,6 @@ func (s *SourceManager) preflightChecks(ctx context.Context) error {
|
||||||
// acquired resources. An error is returned if there was a fatal error during
|
// acquired resources. An error is returned if there was a fatal error during
|
||||||
// the run. This information is also recorded in the JobProgress.
|
// the run. This information is also recorded in the JobProgress.
|
||||||
func (s *SourceManager) run(ctx context.Context, source Source, report *JobProgress) error {
|
func (s *SourceManager) run(ctx context.Context, source Source, report *JobProgress) error {
|
||||||
defer report.Finish()
|
|
||||||
report.Start(time.Now())
|
report.Start(time.Now())
|
||||||
defer func() { report.End(time.Now()) }()
|
defer func() { report.End(time.Now()) }()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue