From 528c4d8f8f4a940b2c69b1a54854d7cbbe0af2c6 Mon Sep 17 00:00:00 2001 From: David Hontecillas Date: Wed, 10 Jul 2024 16:58:22 +0200 Subject: [PATCH] set DNS Cache TTL time on startup --- executor.go | 3 +++ go.mod | 2 +- go.sum | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/executor.go b/executor.go index 94c22273..bafc3417 100644 --- a/executor.go +++ b/executor.go @@ -44,6 +44,7 @@ import ( "github.com/luraproject/lura/v2/logging" "github.com/luraproject/lura/v2/proxy" router "github.com/luraproject/lura/v2/router/gin" + "github.com/luraproject/lura/v2/sd/dnssrv" serverhttp "github.com/luraproject/lura/v2/transport/http/server" server "github.com/luraproject/lura/v2/transport/http/server/plugin" ) @@ -172,6 +173,8 @@ func (e *ExecutorBuilder) NewCmdExecutor(ctx context.Context) cmd.Executor { logger.Info("Working directory is", wd) } + dnssrv.SetTTL(cfg.DNSCacheTTL) + if cfg.Plugin != nil { e.PluginLoaderWithContext.LoadWithContext(ctx, cfg.Plugin.Folder, cfg.Plugin.Pattern, logger) } diff --git a/go.mod b/go.mod index 57d38893..326c1b5b 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,7 @@ require ( github.com/krakendio/krakend-usage/v2 v2.0.0 github.com/krakendio/krakend-viper/v2 v2.0.1 github.com/krakendio/krakend-xml/v2 v2.1.0 - github.com/luraproject/lura/v2 v2.6.3 + github.com/luraproject/lura/v2 v2.6.4-0.20240710140752-dc4f7606e56f github.com/spf13/cobra v1.8.0 github.com/xeipuuv/gojsonschema v1.2.1-0.20200424115421-065759f9c3d7 golang.org/x/sync v0.7.0 diff --git a/go.sum b/go.sum index 1a6009f7..da162c18 100644 --- a/go.sum +++ b/go.sum @@ -544,6 +544,10 @@ github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/luraproject/lura/v2 v2.6.3 h1:4EQynK35ui2o/t7REh1QR+XCPCQhA/kF9h5JTQK8M0o= github.com/luraproject/lura/v2 v2.6.3/go.mod h1:M3TOzbvde5k7f5gGX4GVw3J1UJDYWPtDjHI0KOHbYc0= +github.com/luraproject/lura/v2 v2.6.4-0.20240704173132-be5c8bd69611 h1:EBtzYy+k27/WK/4+MpgDdK1kJU1pA6ZzeETlPHZVneQ= +github.com/luraproject/lura/v2 v2.6.4-0.20240704173132-be5c8bd69611/go.mod h1:D0+LPLJAuT9DcfjB4xvVMCnKmAMQikdbcXmYLdmEA6A= +github.com/luraproject/lura/v2 v2.6.4-0.20240710140752-dc4f7606e56f h1:d5o4ing6laX0TV5Biiy6wuuxE0HMcM+O0QXHcslqDl4= +github.com/luraproject/lura/v2 v2.6.4-0.20240710140752-dc4f7606e56f/go.mod h1:D0+LPLJAuT9DcfjB4xvVMCnKmAMQikdbcXmYLdmEA6A= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=