mirror of
https://github.com/fosrl/newt.git
synced 2026-03-26 12:36:45 +00:00
Bump ping interval up
This commit is contained in:
16
main.go
16
main.go
@@ -302,10 +302,10 @@ func runNewtMain(ctx context.Context) {
|
|||||||
flag.StringVar(&dockerSocket, "docker-socket", "", "Path or address to Docker socket (typically unix:///var/run/docker.sock)")
|
flag.StringVar(&dockerSocket, "docker-socket", "", "Path or address to Docker socket (typically unix:///var/run/docker.sock)")
|
||||||
}
|
}
|
||||||
if pingIntervalStr == "" {
|
if pingIntervalStr == "" {
|
||||||
flag.StringVar(&pingIntervalStr, "ping-interval", "3s", "Interval for pinging the server (default 3s)")
|
flag.StringVar(&pingIntervalStr, "ping-interval", "15s", "Interval for pinging the server (default 15s)")
|
||||||
}
|
}
|
||||||
if pingTimeoutStr == "" {
|
if pingTimeoutStr == "" {
|
||||||
flag.StringVar(&pingTimeoutStr, "ping-timeout", "5s", " Timeout for each ping (default 5s)")
|
flag.StringVar(&pingTimeoutStr, "ping-timeout", "7s", " Timeout for each ping (default 7s)")
|
||||||
}
|
}
|
||||||
// load the prefer endpoint just as a flag
|
// load the prefer endpoint just as a flag
|
||||||
flag.StringVar(&preferEndpoint, "prefer-endpoint", "", "Prefer this endpoint for the connection (if set, will override the endpoint from the server)")
|
flag.StringVar(&preferEndpoint, "prefer-endpoint", "", "Prefer this endpoint for the connection (if set, will override the endpoint from the server)")
|
||||||
@@ -330,21 +330,21 @@ func runNewtMain(ctx context.Context) {
|
|||||||
if pingIntervalStr != "" {
|
if pingIntervalStr != "" {
|
||||||
pingInterval, err = time.ParseDuration(pingIntervalStr)
|
pingInterval, err = time.ParseDuration(pingIntervalStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Invalid PING_INTERVAL value: %s, using default 3 seconds\n", pingIntervalStr)
|
fmt.Printf("Invalid PING_INTERVAL value: %s, using default 15 seconds\n", pingIntervalStr)
|
||||||
pingInterval = 3 * time.Second
|
pingInterval = 15 * time.Second
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pingInterval = 3 * time.Second
|
pingInterval = 15 * time.Second
|
||||||
}
|
}
|
||||||
|
|
||||||
if pingTimeoutStr != "" {
|
if pingTimeoutStr != "" {
|
||||||
pingTimeout, err = time.ParseDuration(pingTimeoutStr)
|
pingTimeout, err = time.ParseDuration(pingTimeoutStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Invalid PING_TIMEOUT value: %s, using default 5 seconds\n", pingTimeoutStr)
|
fmt.Printf("Invalid PING_TIMEOUT value: %s, using default 7 seconds\n", pingTimeoutStr)
|
||||||
pingTimeout = 5 * time.Second
|
pingTimeout = 7 * time.Second
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pingTimeout = 5 * time.Second
|
pingTimeout = 7 * time.Second
|
||||||
}
|
}
|
||||||
|
|
||||||
if dockerEnforceNetworkValidation == "" {
|
if dockerEnforceNetworkValidation == "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user