mirror of
https://github.com/safing/portbase
synced 2025-09-01 01:59:48 +00:00
Database controller should not lock in PushUpdate
This commit is contained in:
parent
643d67aff4
commit
33dcc88dc0
1 changed files with 2 additions and 2 deletions
|
@ -195,6 +195,8 @@ func (c *Controller) Query(q *query.Query, local, internal bool) (*iterator.Iter
|
|||
}
|
||||
|
||||
// PushUpdate pushes a record update to subscribers.
|
||||
// The caller must hold the record's lock when calling
|
||||
// PushUpdate.
|
||||
func (c *Controller) PushUpdate(r record.Record) {
|
||||
if c != nil {
|
||||
c.exclusiveAccess.RLock()
|
||||
|
@ -205,9 +207,7 @@ func (c *Controller) PushUpdate(r record.Record) {
|
|||
}
|
||||
|
||||
for _, sub := range c.subscriptions {
|
||||
r.Lock()
|
||||
push := r.Meta().CheckPermission(sub.local, sub.internal) && sub.q.Matches(r)
|
||||
r.Unlock()
|
||||
|
||||
if push {
|
||||
select {
|
||||
|
|
Loading…
Add table
Reference in a new issue