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,16 +79,22 @@ 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(
body: data, url,
headers: _getHeaders( body: data,
url, headers: _getHeaders(
token, url,
secret: secret, token,
password: password, secret: secret,
idToken: idToken, password: password,
)) idToken: idToken,
.timeout(const Duration(seconds: kMaxPostSeconds)); ),
)
.timeout(
Duration(
seconds: rawResponse ? kMaxRawPostSeconds : kMaxPostSeconds,
),
);
} }
if (rawResponse) { if (rawResponse) {