Skip to content

Commit

Permalink
[bug] - Fix unlocking an unlocked mutex (#1583)
Browse files Browse the repository at this point in the history
* use correct mutext.

* remove unused fxn.
  • Loading branch information
ahrav authored Jul 31, 2023
1 parent 661c6b4 commit 5043fc8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions pkg/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/sources/github/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5043fc8

Please sign in to comment.