From b723f938d8f422a5e7ad44a9868f03f1c23f6765 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Thu, 2 Feb 2023 12:58:33 +0100 Subject: [PATCH] longer timeout for domain dns/connectivity check mostly to allow the first check to succeed. tls certificates will be requested then. --- http/admin.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/http/admin.go b/http/admin.go index ab307df..6814926 100644 --- a/http/admin.go +++ b/http/admin.go @@ -312,8 +312,10 @@ func (Admin) CheckDomain(ctx context.Context, domainName string) (r CheckResult) // todo future: should run these checks without a DNS cache so recent changes are picked up. resolver := dns.StrictResolver{Pkg: "check"} - dialer := &net.Dialer{Timeout: 5 * time.Second} - return checkDomain(ctx, resolver, dialer, domainName) + dialer := &net.Dialer{Timeout: 10 * time.Second} + nctx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + return checkDomain(nctx, resolver, dialer, domainName) } func checkDomain(ctx context.Context, resolver dns.Resolver, dialer *net.Dialer, domainName string) (r CheckResult) {