From 6cb9c6bb2ccada536c034579bde7f2ec95911264 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 4 Jun 2019 23:20:46 +0200 Subject: [PATCH] Increase default timeout --- README.md | 2 +- internal/config/config.go | 2 +- pkg/registry/client.go | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cc561240..a48b6900 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ items: * `watch_repo`: Watch all tags of this `image` repository (default: `false`). * `include_tags`: List of regular expressions to include tags. Can be useful if you use `watch_repo`. * `exclude_tags`: List of regular expressions to exclude tags. Can be useful if you use `watch_repo`. - * `timeout`: Timeout is the maximum amount of time for the TCP connection to establish (default: `5`). + * `timeout`: Timeout is the maximum amount of time for the TCP connection to establish. 0 means no timeout (default: `10`). ## Docker diff --git a/internal/config/config.go b/internal/config/config.go index d9a2b398..8b691560 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -117,7 +117,7 @@ func (cfg *Config) Check() error { } if err := mergo.Merge(&cfg.Items[key], model.Item{ - Timeout: 5, + Timeout: 10, }); err != nil { return err } diff --git a/pkg/registry/client.go b/pkg/registry/client.go index c0db1b15..22fabe73 100644 --- a/pkg/registry/client.go +++ b/pkg/registry/client.go @@ -31,8 +31,6 @@ func (c *Client) timeoutContext(timeout time.Duration) (context.Context, context var cancel context.CancelFunc = func() {} if timeout > 0 { ctx, cancel = context.WithTimeout(ctx, timeout) - } else { - ctx, cancel = context.WithTimeout(ctx, 5*time.Second) } return ctx, cancel }