diff --git a/daemon/rule/loader.go b/daemon/rule/loader.go index cb9b4a3823..fec87b81a0 100644 --- a/daemon/rule/loader.go +++ b/daemon/rule/loader.go @@ -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) }