From ead778218ce5ee5f1dfde4e16c358b21d9b5aab0 Mon Sep 17 00:00:00 2001 From: VnPower Date: Wed, 28 Aug 2024 10:32:33 +0700 Subject: [PATCH] Move the proxy checker up --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index ea244d5..8c0eb0b 100644 --- a/main.go +++ b/main.go @@ -61,6 +61,11 @@ func main() { } template.InitTemplatingEngine(config.GlobalServerConfig.InDevelopment) + // Initialize and start the proxy checker + ctx_timeout, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + config.InitializeProxyChecker(ctx_timeout) + router := defineRoutes() main_handler := func(w_ http.ResponseWriter, r *http.Request) { @@ -118,11 +123,6 @@ func main() { } } - // Initialize and start the proxy checker - ctx_timeout, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - config.InitializeProxyChecker(ctx_timeout) - // run sass when in development mode if config.GlobalServerConfig.InDevelopment { go func() {