Skip to content

Commit

Permalink
qfix: Add net.Dialer with dialTimeout for nsmgr (#395)
Browse files Browse the repository at this point in the history
* add net.Dialer with dialTimeout for nsmgr

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* use withblock instead of custom dialer

Signed-off-by: denis-tingaikin <denis.tingajkin@xored.com>
  • Loading branch information
denis-tingaikin authored Nov 2, 2021
1 parent 5a3e43b commit 609ee76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ type Config struct {
RegistryURL url.URL `default:"tcp://localhost:5001" desc:"A NSE registry url to use" split_words:"true"`
MaxTokenLifetime time.Duration `default:"10m" desc:"maximum lifetime of tokens" split_words:"true"`
LogLevel string `default:"INFO" desc:"Log level" split_words:"true"`
DialTimeout time.Duration `default:"1s" desc:"Timeout for the dial the next endpoint" split_words:"true"`
DialTimeout time.Duration `default:"10ms" desc:"Timeout for the dial the next endpoint" split_words:"true"`
}
1 change: 1 addition & 0 deletions internal/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func RunNsmgr(ctx context.Context, configuration *config.Config) error {
credentials.NewTLS(tlsconfig.MTLSClientConfig(m.source, m.source, tlsconfig.AuthorizeAny())),
),
),
grpc.WithBlock(),
grpc.WithDefaultCallOptions(
grpc.PerRPCCredentials(token.NewPerRPCCredentials(spiffejwt.TokenGeneratorFunc(m.source, configuration.MaxTokenLifetime))),
),
Expand Down

0 comments on commit 609ee76

Please sign in to comment.