Skip to content

Commit 9c8ca03

Browse files
committed
Remove the timeout for now
The message it provides to the user is really unhelpful. The socket exception that shows up when the connection is refused is more helpful.
1 parent d7418bb commit 9c8ca03

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/api/schedule/api_schedule.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@ Future<Schedule> postSchedule(Schedule schedule) async {
1717
final uri = Uri.http(apiUrl, '$scheduleEndpoint');
1818
final response = await httpClient.put(uri,
1919
headers: applicationJsonHeader,
20-
body: jsonEncode(serialize<Schedule>(schedule))).timeout(timeout);
20+
body: jsonEncode(serialize<Schedule>(schedule)));
2121
_expectResponseCode(201, response);
2222
return deserialize<Schedule>(jsonDecode(response.body));
2323
}
2424

2525
Future<List<Schedule>> getSchedules() async {
2626
final uri = Uri.http(apiUrl, scheduleEndpoint);
27-
final response = await httpClient.get(uri).timeout(timeout);
27+
final response = await httpClient.get(uri);
2828
_expectResponseCode(200, response);
2929
// Use the compute function to run parseSchedules in a separate isolate.
3030
return compute(_parseSchedules, response.body);
3131
}
3232

3333
Future<Schedule> getSchedule(String id) async {
3434
final uri = Uri.http(apiUrl, '$scheduleEndpoint/$id');
35-
final response = await httpClient.get(uri).timeout(timeout);
35+
final response = await httpClient.get(uri);
3636
_expectResponseCode(200, response);
3737
return deserialize<Schedule>(jsonDecode(response.body));
3838
}
@@ -41,14 +41,14 @@ Future<Schedule> putSchedule(Schedule schedule, String id) async {
4141
final uri = Uri.http(apiUrl, '$scheduleEndpoint/$id');
4242
final response = await httpClient.put(uri,
4343
headers: applicationJsonHeader,
44-
body: jsonEncode(serialize<Schedule>(schedule))).timeout(timeout);
44+
body: jsonEncode(serialize<Schedule>(schedule)));
4545
_expectResponseCode(200, response);
4646
return deserialize<Schedule>(jsonDecode(response.body));
4747
}
4848

4949
Future<Schedule> deleteSchedule(Schedule schedule, String id) async {
5050
final uri = Uri.http(apiUrl, '$scheduleEndpoint/$id');
51-
final response = await httpClient.delete(uri).timeout(timeout);
51+
final response = await httpClient.delete(uri);
5252
_expectResponseCode(200, response);
5353
return deserialize<Schedule>(jsonDecode(response.body));
5454
}

0 commit comments

Comments
 (0)