Use 5 sec timeout for network test

This commit is contained in:
Ben Adrian Sarmiento
2024-06-16 21:17:36 +02:00
parent f2331c6a2e
commit 7e91eabeca

View File

@@ -183,7 +183,7 @@ func (r *IPRepository) testDomainLatency(client *HTTPClient, domain string) (flo
var totalDuration float64
var retErr error
for i := 0; i < iterations; i++ {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
req, err := http.NewRequestWithContext(ctx, http.MethodGet, testURL, nil)