From 1839664137502146d0229565fc8b94089fb19dac Mon Sep 17 00:00:00 2001 From: samuelbles07 Date: Sat, 1 Feb 2025 14:20:54 +0700 Subject: [PATCH] Extend connect to server timeout Default 5s from HTTPClient --- src/AgApiClient.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/AgApiClient.cpp b/src/AgApiClient.cpp index 8de2596..b2dbf1f 100644 --- a/src/AgApiClient.cpp +++ b/src/AgApiClient.cpp @@ -59,6 +59,7 @@ bool AgApiClient::fetchServerConfiguration(void) { #else HTTPClient client; client.setTimeout(timeoutMs); + client.setConnectTimeout(timeoutMs); if (apiRootChanged) { // If apiRoot is changed, assume not using https if (client.begin(uri) == false) { @@ -134,6 +135,7 @@ bool AgApiClient::postToServer(String data) { #else HTTPClient client; client.setTimeout(timeoutMs); + client.setConnectTimeout(timeoutMs); if (apiRootChanged) { // If apiRoot is changed, assume not using https if (client.begin(uri) == false) {