mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-11 16:47:35 +00:00
rearrange poll, lock, notify
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:

committed by
Kristoffer Dalby

parent
593b3ad981
commit
a8079a2096
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
type Notifier struct {
|
||||
l sync.RWMutex
|
||||
l sync.Mutex
|
||||
nodes map[string]chan<- types.StateUpdate
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ func (n *Notifier) NotifyAll(update types.StateUpdate) {
|
||||
}
|
||||
|
||||
func (n *Notifier) NotifyWithIgnore(update types.StateUpdate, ignore ...string) {
|
||||
n.l.RLock()
|
||||
defer n.l.RUnlock()
|
||||
n.l.Lock()
|
||||
defer n.l.Unlock()
|
||||
|
||||
for key, c := range n.nodes {
|
||||
if util.IsStringInSlice(ignore, key) {
|
||||
|
Reference in New Issue
Block a user