[bug] - Fix unlocking an unlocked mutex (#1583)

* use correct mutext.

* remove unused fxn.
This commit is contained in:
ahrav 2023-07-31 14:06:41 -07:00 committed by GitHub
parent 661c6b47b7
commit 5043fc8756
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 5 deletions

View file

@ -176,10 +176,6 @@ func filterDetectors(filterFunc func(detectors.Detector) bool, input []detectors
return output
}
func (e *Engine) setFoundResults() {
atomic.StoreUint32(&e.numFoundResults, 1)
}
// HasFoundResults returns true if any results are found.
func (e *Engine) HasFoundResults() bool {
return atomic.LoadUint32(&e.numFoundResults) > 0

View file

@ -65,7 +65,7 @@ func (s *Source) cloneRepo(
func (s *Source) getUserAndToken(ctx context.Context, repoURL string, installationClient *github.Client) error {
// We never refresh user provided tokens, so if we already have them, we never need to try and fetch them again.
s.userMu.Lock()
defer s.mu.Unlock()
defer s.userMu.Unlock()
if s.githubUser == "" || s.githubToken == "" {
var err error
s.githubUser, s.githubToken, err = s.userAndToken(ctx, installationClient)