Fix incorrect read-lock for filterlist bloom filter

This commit is contained in:
Patrick Pacher 2021-08-17 12:39:05 +02:00
parent 85af94c063
commit 09bba4198a

View file

@ -6,9 +6,9 @@ import (
"strings"
"sync"
"github.com/tannerryan/ring"
"github.com/safing/portbase/database/record"
"github.com/safing/portbase/log"
"github.com/tannerryan/ring"
)
var defaultFilter = newScopedBloom()
@ -66,8 +66,8 @@ func (bf *scopedBloom) getBloomForType(entityType string) (*ring.Ring, error) {
}
func (bf *scopedBloom) add(scope, value string) {
bf.rw.RLock()
defer bf.rw.RUnlock()
bf.rw.Lock()
defer bf.rw.Unlock()
r, err := bf.getBloomForType(scope)
if err != nil {