Skip to content

Commit

Permalink
added defer to metrics start_scan
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoReigota1 committed May 4, 2021
1 parent d09042e commit b32444f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type serviceSlice []*kics.Service

// StartScan will run concurrent scans by parser
func StartScan(ctx context.Context, scanID string, noProgress bool, services serviceSlice) error {
defer metrics.Metric.Stop()
metrics.Metric.Start("start_scan")
var wg sync.WaitGroup
wgDone := make(chan bool)
Expand Down Expand Up @@ -47,7 +48,6 @@ func StartScan(ctx context.Context, scanID string, noProgress bool, services ser
close(errCh)
return err
}
metrics.Metric.Stop()
return nil
}

Expand Down

0 comments on commit b32444f

Please sign in to comment.