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 kMaxNumberOfHistory = 50;
const int kMaxRecordsPerApiPage = 5000; const int kMaxRecordsPerApiPage = 5000;
const int kMaxPostSeconds = 30; const int kMaxPostSeconds = 30;
const int kMaxRawPostSeconds = 180;
const int kMillisecondsToRefreshData = 1000 * 60 * 15; // 15 minutes const int kMillisecondsToRefreshData = 1000 * 60 * 15; // 15 minutes
const int kUpdatedAtBufferSeconds = 600; const int kUpdatedAtBufferSeconds = 600;
const int kMillisecondsToRefreshActivities = 1000 * 60 * 60 * 24; // 1 day const int kMillisecondsToRefreshActivities = 1000 * 60 * 60 * 24; // 1 day

View File

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