Skip to content

Commit ed832f5

Browse files
authored
Merge pull request #2064 from c3bryant/networking-timeout-increase-qa
Increase Networking Timeout Default
2 parents 6845485 + 74f5c9f commit ed832f5

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lib/app_networking.dart

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ class NetworkHelper {
1414
static const int SSO_REFRESH_MAX_RETRIES = 3;
1515
static const int SSO_REFRESH_RETRY_INCREMENT = 5000;
1616
static const int SSO_REFRESH_RETRY_MULTIPLIER = 3;
17+
static const int DEFAULT_TIMEOUT = 60000;
1718

1819
Future<dynamic> fetchData(String url) async {
1920
Dio dio = new Dio();
20-
dio.options.connectTimeout = 20000;
21-
dio.options.receiveTimeout = 20000;
21+
dio.options.connectTimeout = DEFAULT_TIMEOUT;
22+
dio.options.receiveTimeout = DEFAULT_TIMEOUT;
2223
dio.options.responseType = ResponseType.plain;
2324
final _response = await dio.get(url);
2425

@@ -35,8 +36,8 @@ class NetworkHelper {
3536
Future<dynamic> authorizedFetch(
3637
String url, Map<String, String> headers) async {
3738
Dio dio = new Dio();
38-
dio.options.connectTimeout = 20000;
39-
dio.options.receiveTimeout = 20000;
39+
dio.options.connectTimeout = DEFAULT_TIMEOUT;
40+
dio.options.receiveTimeout = DEFAULT_TIMEOUT;
4041
dio.options.responseType = ResponseType.plain;
4142
dio.options.headers = headers;
4243
final _response = await dio.get(
@@ -111,8 +112,8 @@ class NetworkHelper {
111112
Future<dynamic> authorizedPost(
112113
String url, Map<String, String>? headers, dynamic body) async {
113114
Dio dio = new Dio();
114-
dio.options.connectTimeout = 20000;
115-
dio.options.receiveTimeout = 20000;
115+
dio.options.connectTimeout = DEFAULT_TIMEOUT;
116+
dio.options.receiveTimeout = DEFAULT_TIMEOUT;
116117
dio.options.headers = headers;
117118
final _response = await dio.post(url, data: body);
118119
if (_response.statusCode == 200 || _response.statusCode == 201) {
@@ -142,8 +143,8 @@ class NetworkHelper {
142143
Future<dynamic> authorizedPut(
143144
String url, Map<String, String> headers, dynamic body) async {
144145
Dio dio = new Dio();
145-
dio.options.connectTimeout = 20000;
146-
dio.options.receiveTimeout = 20000;
146+
dio.options.connectTimeout = DEFAULT_TIMEOUT;
147+
dio.options.receiveTimeout = DEFAULT_TIMEOUT;
147148
dio.options.headers = headers;
148149
final _response = await dio.put(url, data: body);
149150

@@ -171,8 +172,8 @@ class NetworkHelper {
171172
Future<dynamic> authorizedDelete(
172173
String url, Map<String, String> headers) async {
173174
Dio dio = new Dio();
174-
dio.options.connectTimeout = 20000;
175-
dio.options.receiveTimeout = 20000;
175+
dio.options.connectTimeout = DEFAULT_TIMEOUT;
176+
dio.options.receiveTimeout = DEFAULT_TIMEOUT;
176177
dio.options.headers = headers;
177178
try {
178179
final _response = await dio.delete(url);

0 commit comments

Comments
 (0)