Prevent heartbeat from crashing server when removing clients

This commit is contained in:
raul 2024-06-11 12:30:52 +02:00
parent bb2620d5ec
commit 85d5bfd1ca
1 changed files with 3 additions and 0 deletions

View File

@ -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",