Increase timeout for selfupdate

This commit is contained in:
Hillel Coren 2021-05-14 16:40:06 +03:00
parent ed64aa4ff9
commit 171ccd1960
2 changed files with 17 additions and 10 deletions

View File

@ -129,6 +129,7 @@ const int kMaxNumberOfCompanies = 10;
const int kMaxNumberOfHistory = 50;
const int kMaxRecordsPerApiPage = 5000;
const int kMaxPostSeconds = 30;
const int kMaxRawPostSeconds = 180;
const int kMillisecondsToRefreshData = 1000 * 60 * 15; // 15 minutes
const int kUpdatedAtBufferSeconds = 600;
const int kMillisecondsToRefreshActivities = 1000 * 60 * 60 * 24; // 1 day

View File

@ -79,16 +79,22 @@ class WebClient {
response = await _uploadFiles(url, token, multipartFiles, data: data);
} else {
response = await http.Client()
.post(url,
body: data,
headers: _getHeaders(
url,
token,
secret: secret,
password: password,
idToken: idToken,
))
.timeout(const Duration(seconds: kMaxPostSeconds));
.post(
url,
body: data,
headers: _getHeaders(
url,
token,
secret: secret,
password: password,
idToken: idToken,
),
)
.timeout(
Duration(
seconds: rawResponse ? kMaxRawPostSeconds : kMaxPostSeconds,
),
);
}
if (rawResponse) {