Extend connect to server timeout

Default 5s from HTTPClient
This commit is contained in:
samuelbles07
2025-02-01 14:20:54 +07:00
parent 4534f7319a
commit 1839664137

View File

@ -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) {