Skip to content
Snippets Groups Projects
Commit 7df8401c authored by vjrj's avatar vjrj
Browse files

Correct wot call

parent 78e70311
No related branches found
No related tags found
No related merge requests found
......@@ -55,8 +55,10 @@ Not found sample:
}
*/
Future<Contact> getWot(Contact contact) async {
final Response response =
await requestCPlusWithRetry('/wot/lookup/${contact.pubkey}');
final Response response = await requestDuniterWithRetry(
'/wot/lookup/${contact.pubkey}',
retryWith404: false);
// Will be better to analyze the 404 response (to detect faulty node)
if (response.statusCode == HttpStatus.ok) {
final Map<String, dynamic> data =
json.decode(response.body) as Map<String, dynamic>;
......@@ -291,6 +293,11 @@ Future<http.Response> requestWithRetry(NodeType type, String path,
return _requestWithRetry(type, path, dontRecord, retryWith404);
}
Future<http.Response> requestDuniterWithRetry(String path,
{bool retryWith404 = true}) async {
return _requestWithRetry(NodeType.duniter, path, true, retryWith404);
}
Future<http.Response> requestCPlusWithRetry(String path,
{bool retryWith404 = true}) async {
return _requestWithRetry(NodeType.cesiumPlus, path, true, retryWith404);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment