Avoid extra broadcasts

This commit is contained in:
tidwall 2018-11-23 15:38:49 -07:00
parent 8906d8e65a
commit 1197cca40c
1 changed files with 9 additions and 7 deletions

View File

@ -172,6 +172,7 @@ func (server *Server) writeAOF(args []string, d *commandDetailsT) error {
// live geofences // live geofences
server.lcond.L.Lock() server.lcond.L.Lock()
if len(server.lives) > 0 {
if d.parent { if d.parent {
// queue children // queue children
for _, d := range d.children { for _, d := range d.children {
@ -182,6 +183,7 @@ func (server *Server) writeAOF(args []string, d *commandDetailsT) error {
server.lstack = append(server.lstack, d) server.lstack = append(server.lstack, d)
} }
server.lcond.Broadcast() server.lcond.Broadcast()
}
server.lcond.L.Unlock() server.lcond.L.Unlock()
} }
return nil return nil