fixed stalled requests after app resume
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:http/http.dart' as http;
|
||||
|
||||
import '../../../model/endpoint_data.dart';
|
||||
import '../../errors/server_exception.dart';
|
||||
import '../../http_errors.dart';
|
||||
import '../nextcloud_ocs.dart';
|
||||
import 'autocomplete_response.dart';
|
||||
|
||||
@@ -30,7 +31,12 @@ class AutocompleteApi {
|
||||
'limit': '10',
|
||||
},
|
||||
);
|
||||
final response = await http.get(uri, headers: NextcloudOcs.headers());
|
||||
final response = (await sendGuarded(
|
||||
'Autocomplete $uri',
|
||||
() => http
|
||||
.get(uri, headers: NextcloudOcs.headers())
|
||||
.timeout(const Duration(seconds: 20)),
|
||||
))!;
|
||||
if (response.statusCode != HttpStatus.ok) {
|
||||
throw ServerException(
|
||||
statusCode: response.statusCode,
|
||||
|
||||
Reference in New Issue
Block a user