Skip to content

Commit

Permalink
Merge pull request #904 from krakend/config_dnsttl
Browse files Browse the repository at this point in the history
set DNS Cache TTL time on startup
  • Loading branch information
kpacha authored Jul 11, 2024
2 parents 3f0b52d + 528c4d8 commit e9443e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,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=
Expand Down

0 comments on commit e9443e8

Please sign in to comment.