mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-21 13:23:07 +01:00
perf: introduces a timeout when fetching host info (#3276)
This commit is contained in:
8
main.go
8
main.go
@@ -103,7 +103,9 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("Could not read certificates")
|
||||
}
|
||||
if err := healthcheck.RPCRequest(agentAddress, certs); err != nil {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), args.Timeout)
|
||||
defer cancel()
|
||||
if err := healthcheck.RPCRequest(ctx, agentAddress, certs); err != nil {
|
||||
log.Fatal().Err(err).Msg("Failed to make request")
|
||||
}
|
||||
}
|
||||
@@ -155,8 +157,8 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("Could not read certificates")
|
||||
}
|
||||
manager := docker_support.NewSwarmClientManager(localClient, certs)
|
||||
multiHostService = docker_support.NewMultiHostService(manager)
|
||||
manager := docker_support.NewSwarmClientManager(localClient, certs, args.Timeout)
|
||||
multiHostService = docker_support.NewMultiHostService(manager, args.Timeout)
|
||||
log.Info().Msg("Starting in swarm mode")
|
||||
listener, err := net.Listen("tcp", ":7007")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user