Prevent heartbeat from crashing server when removing clients
This commit is contained in:
parent
bb2620d5ec
commit
85d5bfd1ca
|
@ -135,6 +135,9 @@ func sendCommand(ID int, command string) (Output string, err error) {
|
||||||
|
|
||||||
func Heartbeat(ID int) {
|
func Heartbeat(ID int) {
|
||||||
for {
|
for {
|
||||||
|
if len(clientList) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
inst := Instructions{
|
inst := Instructions{
|
||||||
IsHeartbeat: true,
|
IsHeartbeat: true,
|
||||||
Message: "PING",
|
Message: "PING",
|
||||||
|
|
Loading…
Reference in New Issue