Skip to content

Commit

Permalink
fixed race condition when deleting a rule
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-iniguez-goya committed Jun 14, 2020
1 parent b03bbf0 commit cfc32cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions daemon/rule/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func NewLoader(liveReload bool) (*Loader, error) {

// NumRules returns he number of loaded rules.
func (l *Loader) NumRules() int {
l.RLock()
defer l.RUnlock()
l.Lock()
defer l.Unlock()
return len(l.rules)
}

Expand Down

0 comments on commit cfc32cb

Please sign in to comment.