forked from airgradienthq/arduino
Extend connect to server timeout
Default 5s from HTTPClient
This commit is contained in:
@ -59,6 +59,7 @@ bool AgApiClient::fetchServerConfiguration(void) {
|
|||||||
#else
|
#else
|
||||||
HTTPClient client;
|
HTTPClient client;
|
||||||
client.setTimeout(timeoutMs);
|
client.setTimeout(timeoutMs);
|
||||||
|
client.setConnectTimeout(timeoutMs);
|
||||||
if (apiRootChanged) {
|
if (apiRootChanged) {
|
||||||
// If apiRoot is changed, assume not using https
|
// If apiRoot is changed, assume not using https
|
||||||
if (client.begin(uri) == false) {
|
if (client.begin(uri) == false) {
|
||||||
@ -134,6 +135,7 @@ bool AgApiClient::postToServer(String data) {
|
|||||||
#else
|
#else
|
||||||
HTTPClient client;
|
HTTPClient client;
|
||||||
client.setTimeout(timeoutMs);
|
client.setTimeout(timeoutMs);
|
||||||
|
client.setConnectTimeout(timeoutMs);
|
||||||
if (apiRootChanged) {
|
if (apiRootChanged) {
|
||||||
// If apiRoot is changed, assume not using https
|
// If apiRoot is changed, assume not using https
|
||||||
if (client.begin(uri) == false) {
|
if (client.begin(uri) == false) {
|
||||||
|
Reference in New Issue
Block a user