From 908218ebac243710a1e064c06fef1bb4f4523422 Mon Sep 17 00:00:00 2001 From: raul Date: Mon, 10 Jun 2024 09:31:02 +0200 Subject: [PATCH] Add option to control heartbeat frequency --- cmd/serverFunc.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/serverFunc.go b/cmd/serverFunc.go index 795b8ff..7df50f2 100644 --- a/cmd/serverFunc.go +++ b/cmd/serverFunc.go @@ -17,6 +17,8 @@ var ( clientList []Client clientIDs int = 0 + heartbeatRate time.Duration = 15 + isUsingJSONParameter bool clientJSONPath string = "/.config/tiamat/clients.json" ) @@ -139,7 +141,7 @@ func Heartbeat(ID int) { return } - time.Sleep(time.Second * 10) + time.Sleep(time.Second * heartbeatRate) } }