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) {
|
||||
for {
|
||||
if len(clientList) == 0 {
|
||||
return
|
||||
}
|
||||
inst := Instructions{
|
||||
IsHeartbeat: true,
|
||||
Message: "PING",
|
||||
|
|
Loading…
Reference in New Issue