From 241cc63e9632cd266898b934d7ad86c790f58a85 Mon Sep 17 00:00:00 2001 From: Daniel N <2color@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:48:20 +0200 Subject: [PATCH] refactor: move default time out to a constant --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 2be8b65..18d973b 100644 --- a/main.go +++ b/main.go @@ -69,6 +69,8 @@ func main() { } } +const DEFAULT_CHECK_TIMEOUT = 60 + func startServer(ctx context.Context, d *daemon, tcpListener, metricsUsername, metricPassword string) error { log.Printf("Starting %s %s\n", name, version) l, err := net.Listen("tcp", tcpListener) @@ -99,7 +101,7 @@ func startServer(ctx context.Context, d *daemon, tcpListener, metricsUsername, m err = errors.New("missing 'cid' query parameter") } - timeout := 60 + timeout := DEFAULT_CHECK_TIMEOUT if timeoutStr != "" { timeout, err = strconv.Atoi(timeoutStr) if err != nil {