mirror of https://github.com/tidwall/tile38.git
Avoid extra broadcasts
This commit is contained in:
parent
8906d8e65a
commit
1197cca40c
|
@ -172,16 +172,18 @@ func (server *Server) writeAOF(args []string, d *commandDetailsT) error {
|
||||||
|
|
||||||
// live geofences
|
// live geofences
|
||||||
server.lcond.L.Lock()
|
server.lcond.L.Lock()
|
||||||
if d.parent {
|
if len(server.lives) > 0 {
|
||||||
// queue children
|
if d.parent {
|
||||||
for _, d := range d.children {
|
// queue children
|
||||||
|
for _, d := range d.children {
|
||||||
|
server.lstack = append(server.lstack, d)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// queue parent
|
||||||
server.lstack = append(server.lstack, d)
|
server.lstack = append(server.lstack, d)
|
||||||
}
|
}
|
||||||
} else {
|
server.lcond.Broadcast()
|
||||||
// queue parent
|
|
||||||
server.lstack = append(server.lstack, d)
|
|
||||||
}
|
}
|
||||||
server.lcond.Broadcast()
|
|
||||||
server.lcond.L.Unlock()
|
server.lcond.L.Unlock()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue